4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt.type_traits

Description

Some additional type traits.

Classes

struct  fcppt::type_traits::is_base_of< Base, Derived >
 Like std::is_base_of, but only works on complete types. More...
 
struct  fcppt::type_traits::is_string< Type >
 Tells if a type is a string. More...
 

Typedefs

template<typename Left , typename Right >
using fcppt::type_traits::implication = std::disjunction<std::negation<Left>, Right>
 The implication function: Left -> Right.
 
template<typename Dest , typename Conv , typename Integral >
using fcppt::type_traits::integral_cast
 Does an integral cast on an integral constant.
 
template<typename Type >
using fcppt::type_traits::is_integral_constant = typename fcppt::type_traits::detail::is_integral_constant<Type>::type
 Checks if a type is a std::integral_constant.
 
template<typename Iterator , typename Category >
using fcppt::type_traits::is_iterator_of_category
 Checks if an iterator models a given category.
 
template<typename Type >
using fcppt::type_traits::is_raw_pointer = typename fcppt::type_traits::detail::is_raw_pointer<Type>::type
 Checks if a pointer is a raw pointer type.
 
template<typename Type >
using fcppt::type_traits::is_value
 Checks if the type behaves like a value type.
 
template<typename Type >
using fcppt::type_traits::numeric_max = std::integral_constant<Type, std::numeric_limits<Type>::max()>
 Metafunction to compute the maximum value of a type.
 
template<typename DestType , typename Src >
using fcppt::type_traits::safe_integral_cast
 Casts std::integral_constants and checks for truncation.
 
template<typename Type >
using fcppt::type_traits::to_bool = fcppt::type_traits::integral_cast<bool, fcppt::cast::static_cast_fun, Type>
 Casts a std::integral_constant to bool.
 
template<typename Container >
using fcppt::type_traits::value_type = typename Container::value_type
 The value type of a container.
 

Variables

template<typename Left , typename Right >
constexpr bool fcppt::type_traits::implication_v = fcppt::type_traits::implication<Left, Right>::value
 The implication function: Left -> Right.
 
template<typename Iterator , typename Category >
constexpr bool fcppt::type_traits::is_iterator_of_category_v
 Checks if an iterator models a given category.
 

Typedef Documentation

◆ implication

template<typename Left , typename Right >
using fcppt::type_traits::implication = std::disjunction<std::negation<Left>, Right>

The implication function: Left -> Right.

Calculates the implication of Left and Right. Equal to (not Left) or Right)

Template Parameters
LeftA boolean expression
RightA boolean expression

◆ integral_cast

template<typename Dest , typename Conv , typename Integral >
using fcppt::type_traits::integral_cast
Initial value:
std::integral_constant<
Dest,
fcppt::type_traits::detail::integral_cast_value<Dest, Conv, Integral>::value>

Does an integral cast on an integral constant.

Casts Integral to an integral constant of type Dest. The cast is done using Conv from fcppt.casts.

Template Parameters
DestAn integral type to cast to
ConvA cast function from fcppt.casts
IntegralA std::integral_constant to cast from

◆ is_integral_constant

template<typename Type >
using fcppt::type_traits::is_integral_constant = typename fcppt::type_traits::detail::is_integral_constant<Type>::type

Checks if a type is a std::integral_constant.

◆ is_iterator_of_category

template<typename Iterator , typename Category >
using fcppt::type_traits::is_iterator_of_category
Initial value:
fcppt::iterator::
category_at_least<typename std::iterator_traits<Iterator>::iterator_category, Category>

Checks if an iterator models a given category.

Checks if Iterator models the iterator category Category. For example, a random access iterator also models a bidrectional iterator.

Template Parameters
IteratorMust be an iterator type
CategoryMust be an iterator category

◆ is_raw_pointer

template<typename Type >
using fcppt::type_traits::is_raw_pointer = typename fcppt::type_traits::detail::is_raw_pointer<Type>::type

Checks if a pointer is a raw pointer type.

A raw pointer is a (cv qualified) pointer to char or to unsigned char. Both can be used to read and write bytes.

Template Parameters
TypeMust be a pointer type.

◆ is_value

template<typename Type >
using fcppt::type_traits::is_value
Initial value:
std::integral_constant<
bool,
!std::is_void_v<Type> && !std::is_array_v<Type> && !std::is_function_v<Type> &&
!std::is_reference_v<Type> && !std::is_const_v<Type> &&
!std::is_volatile_v<Type>>

Checks if the type behaves like a value type.

A type is a value type if it is not cv-qualified, it is not void, not an array, not a function and not a reference. In essence, value types behave normally regarding copying, moving and assignment.

◆ numeric_max

template<typename Type >
using fcppt::type_traits::numeric_max = std::integral_constant<Type, std::numeric_limits<Type>::max()>

Metafunction to compute the maximum value of a type.

Template Parameters
TypeMust be a type such that std::numeric_limits<Type>::max() is defined.

◆ safe_integral_cast

template<typename DestType , typename Src >
using fcppt::type_traits::safe_integral_cast
Initial value:
typename fcppt::type_traits::detail::safe_integral_cast<DestType, Src>::type

Casts std::integral_constants and checks for truncation.

Template Parameters
DestTypeAn integral type.
SrcA std::integral_constant.

◆ to_bool

Casts a std::integral_constant to bool.

Template Parameters
TypeA std::integral_constant.

◆ value_type

template<typename Container >
using fcppt::type_traits::value_type = typename Container::value_type

The value type of a container.

Variable Documentation

◆ implication_v

template<typename Left , typename Right >
bool fcppt::type_traits::implication_v = fcppt::type_traits::implication<Left, Right>::value
inlineconstexpr

The implication function: Left -> Right.

See also
fcppt::type_traits::implication

◆ is_iterator_of_category_v

template<typename Iterator , typename Category >
bool fcppt::type_traits::is_iterator_of_category_v
inlineconstexpr