General Utility Library for C++14  2.7
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 #include "gul14/internal.h"
28 
29 namespace gul14 {
44 template <typename T, typename = int>
45 struct IsContainerLike : std::false_type { };
46 
47 template <typename T>
48 struct IsContainerLike <T,
49  typename std::enable_if_t<true,
50  decltype(std::declval<T>().cbegin(),
51  std::declval<T>().cend(),
52  std::declval<typename T::value_type>(),
53  0)
54  >>
55  : std::true_type { };
56 
57 } // namespace gul14
58 
59 #endif
60 
61 // vi:ts=4:sw=4:sts=4:et
internal.h
Definition of macros used internally by GUL.
gul14
Namespace gul14 contains all functions and classes of the General Utility Library.
Definition: doxygen.h:26
gul14::IsContainerLike
Helper type trait object to determine if a type is a container.
Definition: traits.h:45