General Utility Library for C++14  2.8
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 
46 template <typename T, typename = int>
47 struct IsContainerLike : std::false_type { };
48 
49 template <typename T>
50 struct IsContainerLike <T,
51  typename std::enable_if_t<true,
52  decltype(std::declval<T>().cbegin(),
53  std::declval<T>().cend(),
54  std::declval<typename T::value_type>(),
55  0)
56  >>
57  : std::true_type { };
58 
68 template <typename T>
69 using remove_cvref = typename std::remove_cv<std::remove_reference_t<T>>;
70 
80 template <typename T>
82 
91 template <typename...>
92 using void_t = void;
93 
94 } // namespace gul14
95 
96 #endif
97 
98 // vi:ts=4:sw=4:sts=4:et
Definition of macros used internally by GUL.
Namespace gul14 contains all functions and classes of the General Utility Library.
Definition: doxygen.h:26
typename remove_cvref< T >::type remove_cvref_t
A template metafunction that removes const, volatile, and reference qualifiers from a type.
Definition: traits.h:81
void void_t
A type mapping an arbitrary list of types to void (for SFINAE).
Definition: traits.h:92
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:69
Helper type trait object to determine if a type is a container.
Definition: traits.h:47