C++ Utilities 5.24.8
Useful C++ classes and routines such as argument parser, IO and conversion utilities
|
#include <iterator>
#include <string>
#include <type_traits>
Go to the source code of this file.
Classes | |
struct | CppUtilities::Traits::Bool< B,... > |
Wraps a static boolean constant. More... | |
struct | CppUtilities::Traits::Any< T > |
Evaluates to Bool<true> if at least one of the specified conditions is true; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::Any< Head, Tail... > |
Evaluates to Bool<true> if at least one of the specified conditions is true; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::All< T > |
Evaluates to Bool<true> if all specified conditions are true; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::All< Head, Tail... > |
Evaluates to Bool<true> if all specified conditions are true; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::None< T > |
Evaluates to Bool<true> if none of the specified conditions are true; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::None< Head, Tail... > |
Evaluates to Bool<true> if none of the specified conditions are true; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsSpecializationOf< Type, TemplateTypes > |
Evaluates to Bool<true> if the specified type is based on the specified template; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsSpecializingAnyOf< Type, TemplateTypes > |
Evaluates to Bool<true> if the specified type is based on one of the specified templates; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsSpecializingAnyOf< Type, TemplateType, RemainingTemplateTypes... > |
Evaluates to Bool<true> if the specified type is based on one of the specified templates; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsAnyOf< T > |
Evaluates to Bool<true> if the specified type is any of the specified types; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsAnyOf< Type, OtherType, RemainingTypes... > |
Evaluates to Bool<true> if the specified type is any of the specified types; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsNoneOf< T > |
Evaluates to Bool<true> if the specified type is none of the specified types; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsNoneOf< Type, OtherType, RemainingTypes... > |
Evaluates to Bool<true> if the specified type is none of the specified types; otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsCString< T > |
Evaluates to Bool<true> if the specified type is a C-string (char * or const char *); otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsString< T > |
Evaluates to Bool<true> if the specified type is a standard string, standard string view or C-string (char * or const char *); otherwise evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsComplete< T, typename > |
Evaluates to Bool<true> if the specified type is complete; if the type is only forward-declared it evaluates to Bool<false>. More... | |
struct | CppUtilities::Traits::IsComplete< T, decltype(void(sizeof(T)))> |
Evaluates to Bool<true> if the specified type is complete; if the type is only forward-declared it evaluates to Bool<false>. More... | |
Namespaces | |
namespace | CppUtilities |
Contains all utilities provides by the c++utilities library. | |
namespace | CppUtilities::Traits |
Contains traits for conveniently exploiting SFINAE. | |
Macros | |
#define | CPP_UTILITIES_PP_COMMA , |
The CPP_UTILITIES_PP_COMMA macro helps passing "," as a macro argument. | |
#define | CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK(CheckName, CheckCode) |
The CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK macro defines a type trait for checking whether some operation can be done with a particular type. | |
Typedefs | |
template<typename If , typename Then , typename Else > | |
using | CppUtilities::Traits::Conditional = typename std::conditional<If::value, Then, Else>::type |
Shortcut for std::conditional to omit ::value and type. | |
template<typename T > | |
using | CppUtilities::Traits::Not = Bool<!T::value> |
Negates the specified value. | |
template<typename... Condition> | |
using | CppUtilities::Traits::EnableIf = typename std::enable_if<All<Condition...>::value, Detail::Enabler>::type |
Shortcut for std::enable_if to omit ::value and type. | |
template<typename... Condition> | |
using | CppUtilities::Traits::DisableIf = typename std::enable_if<!All<Condition...>::value, Detail::Enabler>::type |
Shortcut for std::enable_if to negate the condition and omit ::value and type. | |
template<typename... Condition> | |
using | CppUtilities::Traits::EnableIfAny = typename std::enable_if<Any<Condition...>::value, Detail::Enabler>::type |
Shortcut for std::enable_if to apply Traits::Any and omit ::value and type. | |
template<typename... Condition> | |
using | CppUtilities::Traits::DisableIfAny = typename std::enable_if<!Any<Condition...>::value, Detail::Enabler>::type |
Shortcut for std::enable_if to apply Traits::Any, negate the condition and omit ::value and type. | |
Functions | |
CppUtilities::Traits::CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK (IsDereferencable, *(std::declval< T & >())) | |
Evaluates to Bool<true> if the specified type can be dereferenced using the *-operator; otherwise evaluates to Bool<false>. | |
CppUtilities::Traits::CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK (HasSize, std::is_integral< decltype(std::declval< T & >().size())>::value) | |
Evaluates to Bool<true> if the specified type can has a size() method; otherwise evaluates to Bool<false>. | |
CppUtilities::Traits::CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK (IsReservable, std::declval< T & >().reserve(0u)) | |
Evaluates to Bool<true> if the specified type can has a reserve() method; otherwise evaluates to Bool<false>. | |
CppUtilities::Traits::CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK (IsResizable, std::declval< T & >().resize(0u)) | |
Evaluates to Bool<true> if the specified type can has a resize() method; otherwise evaluates to Bool<false>. | |
CppUtilities::Traits::CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK (HasOperatorBool, std::declval< T & >() ? true :false) | |
Evaluates to Bool<true> if the specified type has operator bool(); otherwise evaluates to Bool<false>. | |
CppUtilities::Traits::CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK (IsIteratable, std::begin(std::declval< T & >()) !=std::end(std::declval< T & >()) CPP_UTILITIES_PP_COMMA void() CPP_UTILITIES_PP_COMMA++std::declval< decltype(begin(std::declval< T & >())) & >() CPP_UTILITIES_PP_COMMA void(*begin(std::declval< T & >()))) | |
Evaluates to Bool<true> if the specified type is iteratable (can be used in for-each loop); otherwise evaluates to Bool<false>. | |
template<typename T , EnableIf< IsDereferencable< T > > * = nullptr> | |
constexpr auto & | CppUtilities::Traits::dereferenceMaybe (T &&value) |
Dereferences the specified value if possible; otherwise just returns value itself. | |
#define CPP_UTILITIES_PP_COMMA , |
#define CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK | ( | CheckName, | |
CheckCode ) |
The CPP_UTILITIES_TRAITS_DEFINE_TYPE_CHECK macro defines a type trait for checking whether some operation can be done with a particular type.