#include <algorithm>#include <array>#include <utility>#include <limits>#include <tuple>#include <type_traits>#include <cetl/pf17/type_traits.hpp>

Namespaces | |
| namespace | cetl |
Typedefs | |
| template<typename...> | |
| using | cetl::type_traits_ext::void_t |
Variables | |
| template<template< typename... > class Predicate, typename... Ts> | |
| static constexpr std::size_t | cetl::type_traits_ext::find_v = find<Predicate, Ts...>::value |
| template<template< typename... > class Predicate, typename... Ts> | |
| static constexpr std::size_t | cetl::type_traits_ext::count_v = count<Predicate, Ts...>::value |
| template<template< typename... > class Predicate, typename From, typename... Tos> | |
| constexpr std::size_t | cetl::type_traits_ext::best_conversion_index_v |
Type traits extensions not found in C++ standards.
This is mostly needed for internal use in the library, but can also be useful for users.
| using cetl::pf17::void_t |
Implementation of std::void_t.
|
constexpr |
Index of the type in the Tos list selected by overload resolution for the expression Fun(std::forward<T>(t)) if there was an overload of imaginary function Fun(T_i) for every T_i from Tos... in scope at the same time.
The Predicate is an unary template that, upon successful instantiation with a single argument being a type from the Tos typelist, contains a static member value whose value is truth if the conversion is a valid candidate for acceptance and false if the conversion should not be considered even if it is otherwise valid. The predicate is defined as a variadic template for enhanced composability, as a variadic template template argument can accept both variadic and non-variadic parameters, even if it is only instantiated with one parameter.
Hint: to weed out narrowing conversions, use is_convertible_without_narrowing in the predicate.
If no suitable conversion is available, or the best conversion is ambiguous, the value is std::numeric_limits<std::size_t>::max(). One way to get this error is to choose between long and int on a platform where they have the same size.
|
staticconstexpr |
Alias for count.
|
staticconstexpr |
Alias for find.
/code static_assert(find_v<std::is_integral, int, char, double, std::int64_t, std::int16_t, std::int8_t> == 0, ""); static_assert(find_v<std::is_integral, double, float, std::int64_t, std::int16_t, std::int8_t> == 2, ""); static_assert(find_v<std::is_integral, double, float> == std::numeric_limits<std::size_t>::max(), ""); /endcode