| 1 |
#include <utility> |
| 2 |
#include <string> |
| 3 |
#include <vector> |
| 4 |
#include <queue> |
| 5 |
|
| 6 |
template <typename Type> |
| 7 |
concept bool BasicIterator = |
| 8 |
requires(Type type) |
| 9 |
{ |
| 10 |
*type; |
| 11 |
} |
| 12 |
and requires (Type lhs, Type rhs) |
| 13 |
{ |
| 14 |
{ lhs == rhs; } |
| 15 |
{ lhs != rhs; } |
| 16 |
} |
| 17 |
; |
| 18 |
|
| 19 |
|
| 20 |
template <typename Type> |
| 21 |
concept bool ReadAndIncrementable = |
| 22 |
requires (Type type) |
| 23 |
{ |
| 24 |
requires BasicIterator<Type>; |
| 25 |
++type; |
| 26 |
type++; |
| 27 |
} |
| 28 |
; |
| 29 |
|
| 30 |
|
| 31 |
template <ReadAndIncrementable Type> |
| 32 |
void copy(Type it1, Type it2); |
| 33 |
|
| 34 |
using namespace std; |
| 35 |
|
| 36 |
int main() |
| 37 |
{ |
| 38 |
copy(string{}.begin(), string{}.end()); |
| 39 |
} |