Provides various type traits and their shortcuts. More...
Classes | |
struct | bio::meta::is_type_specialisation_of< source_t, target_template > |
Determines whether a source_type is a specialisation of another template. More... | |
struct | bio::meta::is_value_specialisation_of< source_t, target_template > |
Provides concept bio::meta::template_specialisation_of<mytype, [...]> for checking the type specialisation of some type with a given template, for example a specialized type_list<float> with the type_list template. More... | |
struct | bio::meta::transfer_template_args_onto< source_template< source_arg_types... >, target_template > |
Extracts a type template's type arguments and specialises another template with them. More... | |
struct | bio::meta::transfer_template_vargs_onto< source_template< source_varg_types... >, target_template > |
Extracts a type template's non-type arguments and specialises another template with them. More... | |
struct | bio::meta::valid_template_spec_or< fallback_t, templ_t, spec_t > |
Exposes templ_t<spec_t...> if that is valid, otherwise fallback_t . More... | |
Concepts | |
concept | bio::meta::transformation_trait |
Concept for a transformation trait. | |
concept | bio::meta::unary_type_trait |
Concept for a unary traits type. | |
Macros | |
#define | BIOCPP_IS_CONSTEXPR(...) std::integral_constant<bool, __builtin_constant_p((__VA_ARGS__, 0))>::value |
Returns true if the expression passed to this macro can be evaluated at compile time, false otherwise. | |
#define | BIOCPP_IS_SAME(...) std::is_same_v<__VA_ARGS__> |
A macro that behaves like std::is_same_v, except that it doesn't need to instantiate the template on GCC and Clang. | |
Typedefs | |
template<typename t > | |
using | default_initialisable_wrap_t = std::conditional_t< std::is_nothrow_default_constructible_v< std::remove_cvref_t< t > > &&constexpr_default_initializable< std::remove_cvref_t< t > >, std::remove_cvref_t< t >, std::type_identity< std::remove_cvref_t< t > > > |
Return t as t if it is noexcept- and constexpr-default-constructible; else wrap it in std::type_identity. | |
using | bio::meta::ignore_t = std::remove_cvref_t< decltype(std::ignore)> |
Return the type of std::ignore with const , volatile and references removed (type trait). | |
template<typename t > | |
using | bio::meta::strip_type_identity_t = std::conditional_t< is_type_specialisation_of_v< t, std::type_identity >, transformation_trait_or_t< t, void >, t > |
A transformation trait shortcut that returns the type inside a std::type_identity or the type itself. | |
template<typename source_type , template< typename... > typename target_template> | |
using | bio::meta::transfer_template_args_onto_t = typename transfer_template_args_onto< source_type, target_template >::type |
Shortcut for bio::meta::transfer_template_args_onto (transformation_trait shortcut). | |
template<typename source_type , template< auto... > typename target_template> | |
using | bio::meta::transfer_template_vargs_onto_t = typename transfer_template_vargs_onto< source_type, target_template >::type |
Shortcut for bio::meta::transfer_template_vargs_onto (transformation_trait shortcut). | |
template<typename type_t , typename default_t > | |
using | bio::meta::transformation_trait_or = std::conditional_t< transformation_trait< type_t >, type_t, std::type_identity< default_t > > |
This gives a fallback type if type_t::type is not defined. | |
template<typename type_t , typename default_t > | |
using | bio::meta::transformation_trait_or_t = typename transformation_trait_or< type_t, default_t >::type |
Helper type of bio::meta::transformation_trait_or (transformation_trait shortcut). | |
template<typename fallback_t , template< typename... > typename templ_t, typename... spec_t> | |
using | bio::meta::valid_template_spec_or_t = typename valid_template_spec_or< fallback_t, templ_t, spec_t... >::type |
Helper for bio::meta::valid_template_spec_or (transformation_trait shortcut). | |
Variables | |
template<typename... t> | |
constexpr bool | bio::meta::always_false = false |
A trait that is always false. Can be used for static_assert(false) . DO NOT SPECIALISE! | |
template<typename t > | |
constexpr bool | bio::meta::decays_to_ignore_v = std::is_same_v<std::remove_cvref_t<t>, ignore_t> |
Return whether the input type with const , volatile and references removed is std::ignore's type. (type trait). | |
Provides various type traits and their shortcuts.
#define BIOCPP_IS_CONSTEXPR | ( | ... | ) | std::integral_constant<bool, __builtin_constant_p((__VA_ARGS__, 0))>::value |
Returns true if the expression passed to this macro can be evaluated at compile time, false otherwise.
using default_initialisable_wrap_t = std::conditional_t<std::is_nothrow_default_constructible_v<std::remove_cvref_t<t> > && constexpr_default_initializable<std::remove_cvref_t<t> >, std::remove_cvref_t<t>, std::type_identity<std::remove_cvref_t<t> >> |
Return t as t if it is noexcept- and constexpr-default-constructible; else wrap it in std::type_identity.
t | The type to operate on. |
using bio::meta::strip_type_identity_t = typedef std::conditional_t<is_type_specialisation_of_v<t, std::type_identity>, transformation_trait_or_t<t, void>, t> |
A transformation trait shortcut that returns the type inside a std::type_identity or the type itself.
t | The type to operate on. |
using bio::meta::transfer_template_args_onto_t = typedef typename transfer_template_args_onto<source_type, target_template>::type |
Shortcut for bio::meta::transfer_template_args_onto (transformation_trait shortcut).
using bio::meta::transfer_template_vargs_onto_t = typedef typename transfer_template_vargs_onto<source_type, target_template>::type |
Shortcut for bio::meta::transfer_template_vargs_onto (transformation_trait shortcut).
using bio::meta::transformation_trait_or = typedef std::conditional_t<transformation_trait<type_t>, type_t, std::type_identity<default_t> > |
This gives a fallback type if type_t::type is not defined.
type_t | The type to use if type_t::type is defined. |
default_t | The type to use otherwise. |
Gives type_t back if T::type is a member type, otherwise struct{using type = default_t}.
bio::meta::transformation_trait_or_t as a shorthand for typename bio::meta::transformation_trait_or::type
using bio::meta::transformation_trait_or_t = typedef typename transformation_trait_or<type_t, default_t>::type |
Helper type of bio::meta::transformation_trait_or (transformation_trait shortcut).
using bio::meta::valid_template_spec_or_t = typedef typename valid_template_spec_or<fallback_t, templ_t, spec_t...>::type |
Helper for bio::meta::valid_template_spec_or (transformation_trait shortcut).
fallback_t | The fallback type. |
templ_t | The type template that should be specialised. |
spec_t | The specialisation for the type template. |
|
inlineconstexpr |
Return whether the input type with const
, volatile
and references removed is std::ignore's type. (type trait).
t | The type to operate on. |