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