Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
24.operations.stdcxx-234.cpp
Go to the documentation of this file.
1
30#include <iterator>
31
32struct X: std::iterator<std::random_access_iterator_tag, int> { };
33
34namespace std {
35
36// specialize the std::distance() function template of a user-defined
37// iterator type to verify that the signature of the primary template
38// is the same as the one of the specialization
39template <> std::iterator_traits<X>::difference_type
40distance<X> (X, X) { return 0; }
41
42} // namespace std
43
44int main ()
45{
46 return int (std::distance (X (), X ()));
47}
Definition json.h:5363