concepts


1. Concept for Type Checking:

template<typename T>
concept Number = requires(T x) {
    x + x;
};

Ensures T has a + operator.

2. Concept for Predicate:

template<typename T>
concept Predicate = requires(T x) {
    { x(42) } -> bool;
};

Verifies T is a callable that returns a boolean.

3. Concept for Iterator:

template<typename T>
concept Iterator = requires(T x) {
    x++;
    *x;
};

Checks for the presence of increment and dereference operators.

4. Concept for Range:

Ensures T has begin() and end() returning iterators.

5. Concept for Copyable:

Verifies T can be copied using the assignment operator.

6. Concept for Moveable:

Checks T can be moved using std::move.

7. Concept for Default Constructible:

Ensures T has a default constructor.

8. Concept for Output Iterator:

Verifies *x can be assigned a value.

9. Concept for Input Iterator:

Checks *x can be incremented.

10. Concept for Forward Iterator:

Ensures ++ and == operators work correctly.

11. Concept for Bidirectional Iterator:

Verifies the -- operator exists and works as expected.

12. Concept for Random Access Iterator:

Ensures + and - operators support random access.

13. Concept for Less Than Comparable:

Verifies T can be compared using <.

14. Concept for Equality Comparable:

Checks T can be compared for equality using ==.

15. Concept for Pointer:

Ensures T is a pointer type that can be dereferenced.

16. Concept for Reference:

Verifies T is a reference type that can be dereferenced.

17. Concept for Array:

Checks T is an array type that supports indexing.

18. Concept for Function Pointer:

Ensures T is a function pointer that can be called.

19. Concept for Callable Object:

Verifies T is a callable object that can be invoked.

20. Concept for Regular Expression:

Checks T is a regular expression that can be matched against text.

21. Concept for Tuple:

Ensures T is a tuple that supports accessing elements by index.

22. Concept for Void Function:

Verifies T is a function that returns void.

23. Concept for Copy Constructible:

Ensures T can be copy constructed from another object of the same type.

24. Concept for Move Constructible:

Verifies T can be move constructed from another object of the same type.

25. Concept for Assignable:

Checks T supports the assignment operator.

26. Concept for Swappable:

Ensures T can be swapped using the std::swap function.

27. Concept for Destructible:

Verifies T has a destructor.

28. Concept for Integral:

Checks T is an integral type that supports arithmetic operations.

29. Concept for Floating Point:

Ensures T is a floating-point type that supports arithmetic operations.

30. Concept for Boolean:

Verifies T is a boolean type that supports logical operations.

31. Concept for String:

Checks T is a string type that supports accessing the length.

32. Concept for Vector:

Ensures T is a vector type that supports accessing the length and pushing elements.

33. Concept for List:

Verifies T is a list type that supports accessing the length, pushing elements, and getting the first element.

34. Concept for Set:

Checks T is a set type that supports accessing the length and inserting elements.

35. Concept for Map:

Ensures T is a map type that supports accessing the length and inserting/accessing elements by key.

36. Concept for Optional:

Verifies T is an optional type that supports checking for a value and accessing the value if present.

37. Concept for Union:

Checks T is a union type that supports checking for and accessing elements of a specific type.

38. Concept for Variant:

Ensures T is a variant type that supports accessing the index and getting elements of a specific type.

39. Concept for Iterator Pair:

Verifies T is a pair of iterators that can be accessed by first and second.

40. Concept for Pair:

Checks T is a pair that can be accessed by first and second.

41. Concept for Triple:

Ensures T is a triple that can be accessed by first, second, and third.

42. Concept for Quadruple:

Verifies T is a quadruple that can be accessed by first, second, third, and fourth.

43. Concept for Reference Wrapper:

Checks T is a reference wrapper that can be dereferenced.

44. Concept for Smart Pointer:

Ensures T is a smart pointer that can be dereferenced.

45. Concept for Container:

Verifies T is a container type that supports accessing iterators to its elements.

46. Concept for Associative Container:

Checks T is an associative container type that supports finding elements by key.

47. Concept for Fixed-Size Buffer:

Ensures T is a fixed-size buffer type that supports accessing elements by index.

48. Concept for Resizable Buffer:

Verifies T is a resizable buffer type that supports accessing the length and resizing.

49. Concept for File:

Checks T is a file type that supports checking for being open and writing data.

50. Concept for Thread:

Ensures T is a thread type that supports starting and joining.