framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mutator_type.hpp
Go to the documentation of this file.
1 // Copyright (C) 2012 iwg molw5
2 // For conditions of distribution and use, see copyright notice in COPYING
3 
13 #pragma once
14 
15 #include <type_traits>
16 
18 
19 namespace framework
20 {
21  namespace serializable
22  {
23  namespace detail
24  {
25  template <typename T, typename Enabler = void>
26  struct is_mutator_type_impl;
27 
28  template <typename T>
29  struct mutator_child_impl;
30 
31  template <typename T, typename Enabler = void>
32  struct type_extractor_impl;
33  }
34 
67  template <typename Child>
68  struct mutator_type
69  {
70 // GCC bug workaround - www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#580
71 #if MAX_GNUC_VERSION(4, 8, 0)
72  public:
73 #else
74  template <typename T, typename Enabler>
75  friend struct detail::is_mutator_type_impl;
76 
77  template <typename T>
78  friend struct detail::mutator_child_impl;
79 
80  private:
81 #endif
82  using serializable_mutator_type_enabler = void;
83  using serializable_mutator_child = Child;
84 
85  mutator_type () = delete;
86  ~mutator_type () = delete;
87  };
88 
95  template <typename T>
96  using is_mutator_type = typename detail::is_mutator_type_impl <T>::type;
97 
105  template <typename T>
106  using mutator_child = typename detail::mutator_child_impl <T>::type;
107 
118  template <typename T>
119  using type_extractor = typename detail::type_extractor_impl <T>::type;
120  }
121 }
122 
123 #include <framework/serializable/mutator_type.inl>