The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017



The type of an iterator difference.

typedef std::ptrdiff_t difference_type;

The type is a synonym for std::ptrdiff_t.



// std_tr1__regex__regex_iterator_difference_type.cpp 
// compile with: /EHsc 
#include <regex> 
#include <iostream> 

typedef std::regex_iterator<const char *> Myiter; 
int main() 
    const char *pat = "axayaz"; 
    Myiter::regex_type rx("a"); 
    Myiter next(pat, pat + strlen(pat), rx); 
    Myiter end; 

    for (; next != end; ++next) 
        std::cout << "match == " << next->str() << std::endl; 

// other members 
    Myiter it1(pat, pat + strlen(pat), rx); 
    Myiter it2(it1); 
    next = it1; 

    Myiter::iterator_category cat = std::forward_iterator_tag(); 
    Myiter::difference_type dif = -3; 
    Myiter::value_type mr = *it1; 
    Myiter::reference ref = mr; 
    Myiter::pointer ptr = &ref; 

    dif = dif; // to quiet "unused" warnings 
    ptr = ptr; 

    return (0); 

match == a
match == a
match == a


Header: <regex>

Namespace: std