| 1 |
// PR c++/58083 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
namespace details { |
| 5 |
struct iterator_concept_checker |
| 6 |
{ |
| 7 |
typedef char yes_type; |
| 8 |
typedef char (&no_type)[2]; |
| 9 |
|
| 10 |
template <typename T> |
| 11 |
static no_type test(...); |
| 12 |
|
| 13 |
template <typename T> |
| 14 |
static yes_type test( |
| 15 |
int* |
| 16 |
, void (*)(T) = [](T it) |
| 17 |
{ |
| 18 |
auto copy = T{it}; // copy constructible |
| 19 |
copy = it; // copy assignable |
| 20 |
copy.~T(); // destroyable |
| 21 |
++it; // incrementable |
| 22 |
} |
| 23 |
); |
| 24 |
}; |
| 25 |
} |
| 26 |
|
| 27 |
int main() |
| 28 |
{ |
| 29 |
details::iterator_concept_checker::test<int>(0); |
| 30 |
} |