siplasplas
A library for C++ reflection and introspection
valuesemantics.hpp
1 #ifndef SIPLASPLAS_TYPEERASURE_CONCEPTS_VALUESEMANTICS_HPP
2 #define SIPLASPLAS_TYPEERASURE_CONCEPTS_VALUESEMANTICS_HPP
3 
4 #include "concept.hpp"
5 #include <type_traits>
6 
12 namespace cpp
13 {
14 
15 namespace concepts
16 {
17 
27 template<typename T>
29  std::is_default_constructible<T>::value,
30  std::is_nothrow_default_constructible<T>::value
31 > {};
32 
33 
45 template<typename T, typename... Args>
46 class Constructible : public Concept<
47  std::is_constructible<T, Args...>::value,
48  std::is_nothrow_constructible<T, Args...>::value
49 > {};
50 
51 
61 template<typename T>
62 class CopyConstructible : public Concept<
63  std::is_copy_constructible<T>::value,
64  std::is_nothrow_copy_constructible<T>::value
65 > {};
66 
67 
77 template<typename T>
78 class MoveConstructible : public Concept<
79  std::is_move_constructible<T>::value,
80  std::is_nothrow_move_constructible<T>::value
81 > {};
82 
83 
94 template<typename T, typename U>
95 class Assignable : public Concept<
96  std::is_assignable<T, U>::value,
97  std::is_nothrow_assignable<T, U>::value
98 > {};
99 
100 
110 template<typename T>
111 class CopyAssignable : public Concept<
112  std::is_copy_assignable<T>::value,
113  std::is_nothrow_copy_assignable<T>::value
114 > {};
115 
116 
126 template<typename T>
127 class MoveAssignable : public Concept<
128  std::is_move_assignable<T>::value,
129  std::is_nothrow_move_assignable<T>::value
130 > {};
131 
132 
142 template<typename T>
143 class Destructible : public Concept<
144  std::is_destructible<T>::value,
145  std::is_nothrow_destructible<T>::value
146 > {};
147 
148 }
149 
150 }
151 
152 #endif // SIPLASPLAS_TYPEERASURE_CONCEPTS_VALUESEMANTICS_HPP
Checks if a type satisfies the constructible concept with the given constructor arguments.
Definition: valuesemantics.hpp:46
Checks if a type satisfies the move assignable concept
Definition: valuesemantics.hpp:127
Checks if a type satisfies the destructible concept
Definition: valuesemantics.hpp:143
Definition: canary_allocator.hpp:7
Checks if a type satisfies the default constructible concept
Definition: valuesemantics.hpp:28
Checks if a type satisfies the assignable concept
Definition: valuesemantics.hpp:95
Checks if a type satisfies the copy assignable concept
Definition: valuesemantics.hpp:111
Checks if a type satisfies the copy constructible concept
Definition: valuesemantics.hpp:62
Checks if a type satisfies the move constructible concept
Definition: valuesemantics.hpp:78
Represents a concept.
Definition: concept.hpp:28