chsvlib
chsv helper source code
chsvmetafun.h File Reference

Ancillary template-based metafunctions. More...

#include "chsvbase.h"
#include "chsvsal.h"
#include <chsvlib/chsvexception.h>
#include <cstdint>
#include <type_traits>
#include <functional>

Classes

struct  identity< T >
 
struct  integral_sequence< T, ind >
 A type used to unpack tuples and pass its elements as a sequence of parameters via std::get <ind>(tuple_object)... . The type can be obtained at compile time using the integral_sequence_maker metafunction. More...
 
struct  integral_sequence_maker< T, sequence_size >
 For a given size provides a type member "type" specifying an integral sequence (inclusively starting from 0 to the sequence_size - 1) of the integral_sequence type. Used to sequentially extract parameters of a variadic template like std::tuple during a function call. More...
 
struct  function_traits< Callable >
 Provides traits of a Callable type: return type, parameter types, and a number of parameters. More...
 
struct  is_reference_wrapper< T >
 Checks whether a type T is an std::reference_wrapper object. Inherits from the resulting std::integral_constant instantiation. More...
 
struct  is_equality_comparable< T >
 Checks whether a type T satisfies the EqualityComparable requirements. More...
 
struct  is_testable_by_negation< T >
 Checks whether a type T supports an unary negation operator, that is whether for an object T x an expression !x would be well-formed and convertible to bool. More...
 
struct  iteratable_type_traits< T >
 If the specified type is iteratable, the class inherits members of std::iterator_traits specialized for the iterator of the specified type. More...
 
struct  is_iteratable_type< T >
 Checks whether a given type is iteratable. More...
 

Namespaces

 Chusov
 Basic chsvlib namespace.
 

Macros

#define CHSV_DEFINE_ENUM_BITMASKTYPE(enum_type)
 Defines operators required for an enum to meet BitmaskType requirements. More...
 

Typedefs

template<class T >
using identity_t = typename identity< T >::type
 Introduces type dependency to prohibit template argument deduction. More...
 
template<class... Ts>
using void_t = void
 

Functions

template<class F , class... ArgTypes>
auto invoke (F &&f, ArgTypes &&... args) noexcept(noexcept(Implementation::INVOKE(std::forward< F >(f), std::forward< ArgTypes >(args)...))) -> decltype(Implementation::INVOKE(std::forward< F >(f), std::forward< ArgTypes >(args)...))
 Invokes a Callable object with a given set of arguments. Implements behaviour of the C++17 std::invoke function via C++11. More...
 
template<class To , class From >
constexpr bool cast_overflows (From val) noexcept
 Checks whether conversion of the parameter to the given type would overflow. More...
 
template<class T >
constexpr auto to_signed (T val)
 Attempts to converts an integral to its signed form without losing information and throws an exception, if that is not possible. More...
 

Variables

template<class T , class U >
constexpr bool is_swappable_with_v
 C++14 compliant implementation of std::is_swappable_with_v from <type_traits> of C++17. More...
 
template<class T , class U >
constexpr bool is_nothrow_swappable_with_v
 C++14 compliant implementation of std::is_nothrow_swappable_with_v from <type_traits> of C++17. More...
 
template<class T >
constexpr bool is_swappable_v
 C++14 compliant implementation of std::is_swappable from <type_traits> of C++17. More...
 
template<class T >
constexpr bool is_nothrow_swappable_v
 C++14 compliant implementation of std::is_nothrow_swappable_v from <type_traits> of C++17. More...
 
template<class T >
constexpr bool is_iteratable_type_v = is_iteratable_type<T>::value
 Resolves to true, if a given type is iteratable, and to false otherwise. More...
 

Detailed Description

Ancillary template-based metafunctions.