General Utility Library for C++14  2.9
traits.h
Go to the documentation of this file.
1 
23 #ifndef GUL14_TRAITS_H_
24 #define GUL14_TRAITS_H_
25 
26 #include <type_traits>
27 
28 #include "gul14/internal.h"
29 
30 namespace gul14 {
31 
52 template <typename T, typename = int>
53 struct IsContainerLike : std::false_type { };
54 
55 template <typename T>
56 struct IsContainerLike <T,
57  typename std::enable_if_t<true,
58  decltype(std::declval<T>().cbegin(),
59  std::declval<T>().cend(),
60  std::declval<typename T::value_type>(),
61  0)
62  >>
63  : std::true_type { };
64 
74 template <typename T>
75 using remove_cvref = typename std::remove_cv<std::remove_reference_t<T>>;
76 
86 template <typename T>
88 
97 template <typename...>
98 using void_t = void;
99 
101 
102 } // namespace gul14
103 
104 #endif
105 
106 // vi:ts=4:sw=4:sts=4:et
typename remove_cvref< T >::type remove_cvref_t
A template metafunction that removes const, volatile, and reference qualifiers from a type.
Definition: traits.h:87
void void_t
A type mapping an arbitrary list of types to void (for SFINAE).
Definition: traits.h:98
typename std::remove_cv< std::remove_reference_t< T > > remove_cvref
A template metafunction that removes const, volatile, and reference qualifiers from a type.
Definition: traits.h:75
Definition of macros used internally by GUL.
Namespace gul14 contains all functions and classes of the General Utility Library.
Definition: doxygen.h:26
Helper type trait object to determine if a type is a container.
Definition: traits.h:53