VCCC  2024.05
VisualCamp Common C++ library
check_overload.h
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2021/05/30.
3 # */
4 #
5 #
6 # ifndef VCCC_OPTIONAL_INTERNAL_CHECK_OVERLOAD_H_
7 # define VCCC_OPTIONAL_INTERNAL_CHECK_OVERLOAD_H_
8 #
9 # include <type_traits>
10 
11 
12 namespace vccc {
13 namespace internal {
14 namespace optional {
15 
17 struct check_copy_constructible {};
18 template<typename T>
19 struct check_copy_constructible<T, false> {
20  check_copy_constructible() = default;
21  check_copy_constructible(check_copy_constructible const&) = delete;
22  check_copy_constructible(check_copy_constructible &&) = default;
23  check_copy_constructible& operator=(check_copy_constructible const&) = default;
24  check_copy_constructible& operator=(check_copy_constructible &&) = default;
25 };
26 
28 struct check_move_constructible {};
29 template<typename T>
30 struct check_move_constructible<T, false> {
31  check_move_constructible() = default;
32  check_move_constructible(check_move_constructible const&) = default;
33  check_move_constructible(check_move_constructible &&) = delete;
34  check_move_constructible& operator=(check_move_constructible const&) = default;
35  check_move_constructible& operator=(check_move_constructible &&) = default;
36 };
37 
39 struct check_copy_assignable {};
40 template<typename T>
41 struct check_copy_assignable<T, false> {
42  check_copy_assignable() = default;
43  check_copy_assignable(check_copy_assignable const&) = default;
44  check_copy_assignable(check_copy_assignable &&) = default;
45  check_copy_assignable& operator=(check_copy_assignable const&) = delete;
46  check_copy_assignable& operator=(check_copy_assignable &&) = default;
47 };
48 
50 struct check_move_assignable {};
51 template<typename T>
52 struct check_move_assignable<T, false> {
53  check_move_assignable() = default;
54  check_move_assignable(check_move_assignable const&) = default;
55  check_move_assignable(check_move_assignable &&) = default;
56  check_move_assignable& operator=(check_move_assignable const&) = default;
57  check_move_assignable& operator=(check_move_assignable &&) = delete;
58 };
59 
60 
61 
62 } // namespace optional
63 } // namespace internal
64 } // namespace vccc
65 
66 # endif // VCCC_OPTIONAL_INTERNAL_CHECK_OVERLOAD_H_
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35