Skip to content

Commit 971456c

Browse files
rdmarsh2MathiasVP
authored andcommitted
C++: add a test for self-valued iterators
1 parent 2187e56 commit 971456c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include "../../../include/iterator.h"
2+
int source();
3+
4+
template<typename T>
5+
void sink(T);
6+
7+
template<> struct std::iterator_traits<unsigned long>
8+
{ // get traits from integer type
9+
typedef std::input_iterator_tag iterator_category;
10+
typedef unsigned long value_type;
11+
typedef unsigned long difference_type;
12+
typedef unsigned long distance_type;
13+
typedef unsigned long * pointer;
14+
typedef unsigned long& reference;
15+
};
16+
17+
18+
int test() {
19+
unsigned long x = source();
20+
sink(x); // $ ast MISSING: ir
21+
}

0 commit comments

Comments
 (0)