piranha
0.10
|
Type traits. More...
#include <cstdarg>
#include <cstddef>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <limits>
#include <ostream>
#include <tuple>
#include <type_traits>
#include <utility>
#include <piranha/config.hpp>
Go to the source code of this file.
Namespaces | |
piranha | |
Root piranha namespace. | |
Macros | |
#define | PIRANHA_DECLARE_HAS_TYPEDEF(type_name) |
Macro to test if class has type definition. More... | |
#define | PIRANHA_TT_CHECK(tt, ...) static_assert(tt<__VA_ARGS__>::value, "type trait check failure -> " #tt "<" #__VA_ARGS__ ">") |
Macro for static type trait checks. More... | |
Typedefs | |
template<typename T , typename... Args> | |
using | piranha::min_int = typename detail::min_int_impl< T, Args... >::type |
Detect narrowest integer type. More... | |
template<typename T , typename... Args> | |
using | piranha::max_int = typename detail::max_int_impl< T, Args... >::type |
Detect widest integer type. More... | |
Type traits.
This header contains general-purpose type traits classes.
Definition in file type_traits.hpp.
#define PIRANHA_DECLARE_HAS_TYPEDEF | ( | type_name | ) |
Macro to test if class has type definition.
This macro will declare a struct template parametrized over one type T
and called has_typedef_type_name
, whose static const bool member value
will be true
if T
contains a typedef
called type_name
, false
otherwise.
For instance:
has_typedef_foo_type<foo>::value
will be true and has_typedef_foo_type<bar>::value
will be false.
Definition at line 769 of file type_traits.hpp.
#define PIRANHA_TT_CHECK | ( | tt, | |
... | |||
) | static_assert(tt<__VA_ARGS__>::value, "type trait check failure -> " #tt "<" #__VA_ARGS__ ">") |
Macro for static type trait checks.
This macro will check via a static_assert
that the template type trait tt
provides a true
value
. The variadic arguments are interpreted as the template arguments of tt
.
Definition at line 786 of file type_traits.hpp.