mn_copyable.hpp
Go to the documentation of this file.
1 
20 #ifndef __MINILIB_TAG_3ba66bf1_9f2a_4ae7_a110_aa6d418b914__
21 #define __MINILIB_TAG_3ba66bf1_9f2a_4ae7_a110_aa6d418b914__
22 
23 #include "mn_config.hpp"
24 
25 #define MN_ONCOPYABLE_CLASS public mn::only_copyable_tag<void>
26 #define MN_ONMOVABLE_CLASS public mn::only_move_tag<void>
27 #define MN_ONSIGLETN_CLASS public mn::only_oneable_tag<void>
28 
29 #define MN_DEFAULT_CLASS public mn::copy_move_tag<void>
30 
31 namespace mn {
35  template <typename t>
37  public:
39 
40  only_copyable_tag() = default;
41 
42  only_copyable_tag(const this_type& other) = default;
43  this_type& operator=(const this_type& other) = default;
44  };
45 
49  template <typename t>
50  class only_move_tag {
51  public:
53 
54  only_move_tag() = default;
55 
56  only_move_tag(this_type&& other) = default;
57  only_move_tag(const this_type&) = delete;
58 
59  this_type& operator=(const this_type&) = delete;
60  this_type& operator=(this_type&& other) = default;
61  };
62 
66  template <typename t>
68  public:
70 
71  only_oneable_tag() = default;
72 
73  only_oneable_tag(this_type&& other) = delete;
74  only_oneable_tag(const this_type&) = delete;
75 
76  this_type& operator=(const this_type&) = delete;
77  this_type& operator=(this_type&& other) = delete;
78  };
79 
83  template <typename t>
84  class copy_move_tag {
85  public:
87 
88  copy_move_tag() = default;
89  };
90 }
91 
92 #endif // __MINILIB_TAG_3ba66bf1_9f2a_4ae7_a110_aa6d418b914__
copyable and movable
Definition: mn_copyable.hpp:84
copy_move_tag()=default
Not movable.
Definition: mn_copyable.hpp:36
only_copyable_tag(const this_type &other)=default
this_type & operator=(const this_type &other)=default
only_copyable_tag()=default
Not copyable.
Definition: mn_copyable.hpp:50
this_type & operator=(const this_type &)=delete
only_move_tag(const this_type &)=delete
only_move_tag(this_type &&other)=default
this_type & operator=(this_type &&other)=default
only_move_tag()=default
Not copyable or movable.
Definition: mn_copyable.hpp:67
only_oneable_tag(const this_type &)=delete
only_oneable_tag(this_type &&other)=delete
only_oneable_tag()=default
this_type & operator=(const this_type &)=delete
this_type & operator=(this_type &&other)=delete
Definition: mn_allocator_typetraits.hpp:25