General Utility Library for C++17 26.5.0
traits.h
Go to the documentation of this file.
1
26#ifndef GUL17_TRAITS_H_
27#define GUL17_TRAITS_H_
28
29#include <functional> // for std::invoke on C++17 compilers
30#include <type_traits>
31#include <utility>
32
33#include "gul17/internal.h"
34
35namespace gul17 {
36
57template <typename T, typename = int>
58struct IsContainerLike : std::false_type { };
59
60template <typename T>
61struct IsContainerLike <T,
62 typename std::enable_if_t<true,
63 decltype(std::declval<T>().cbegin(),
64 std::declval<T>().cend(),
65 std::declval<typename T::value_type>(),
66 0)
67 >>
68 : std::true_type { };
69
79template <typename T>
80using remove_cvref = typename std::remove_cv<std::remove_reference_t<T>>;
81
91template <typename T>
93
95
96} // namespace gul17
97
98#endif
99
100// vi:ts=4:sw=4:sts=4:et
auto constexpr bit_set(unsigned bit) noexcept -> ReturnT
Set a bit in an integral type.
Definition bit_manip.h:124
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:80
typename remove_cvref< T >::type remove_cvref_t
A template metafunction that removes const, volatile, and reference qualifiers from a type.
Definition traits.h:92
Definition of macros used internally by GUL.
Namespace gul17 contains all functions and classes of the General Utility Library.
Definition doxygen.h:29
Helper type trait object to determine if a type is a container.
Definition traits.h:58