Kaspersky Neuromorphic Platform  1.0.0
API Reference
Loading...
Searching...
No Matches
knp::meta Namespace Reference

Metaprogramming library namespace. More...

Detailed Description

Metaprogramming library namespace.

Typedef Documentation

◆ mp_flt

template<class AllList , class L >
using knp::meta::mp_flt = boost::mp11::mp_filter_q<boost::mp11::mp_bind_front<mp_neq, boost::mp11::mp_size<AllList>>, L>

List of types from the global type list that are used in the local type list.

Template Parameters
AllListglobal list of types.
Llocal list of types (subset of AllList).

Definition at line 54 of file stringify.h.

◆ mp_neq

template<class T1 , class T2 >
using knp::meta::mp_neq = boost::mp11::mp_bool<T1::value != T2::value>

Template used to determine if two arbitrary types are not the same at the compile stage.

mp_neq takes the value of true if the types are not the same, otherwise mp_neq takes the value of false.

Template Parameters
T1first arbitrary type to compare.
T2second arbitrary type to compare.

Definition at line 46 of file stringify.h.

◆ mp_supported_indexes

template<class AllList , class L >
using knp::meta::mp_supported_indexes
Initial value:
boost::mp11::mp_filter_q< boost::mp11::mp_bind_front< mp_neq, boost::mp11::mp_size< AllList > >, L > mp_flt
List of types from the global type list that are used in the local type list.
Definition stringify.h:54

Index array for types from the global type list that are used in the local type list.

Template Parameters
AllListglobal list of types.
Llocal list of types (subset of AllList).

Definition at line 62 of file stringify.h.

Function Documentation

◆ get_supported_type_indexes()

template<typename AllTypes , typename SupportedTypes >
std::vector< size_t > knp::meta::get_supported_type_indexes ( )

Get supported type indexes.

Template Parameters
AllTypesglobal list of types.
SupportedTypeslocal list of types.
Returns
vector with indexes of supported types.

Definition at line 84 of file stringify.h.

◆ get_supported_type_names()

template<typename AllTypes , typename SupportedTypes , typename NamesType >
std::vector< std::string > knp::meta::get_supported_type_names ( const NamesType & type_names)

Get names of supported object types.

Parameters
type_namescontainer (usually a tuple) of type names.
Template Parameters
AllTypesglobal list of types.
SupportedTypeslocal list of types.
NamesTypecontainer type (automatically derived from type_names if not specified).
Returns
vector of type names.

Definition at line 104 of file stringify.h.

◆ load_from_container()

template<typename SupportedTypes , typename AllVariants , typename ToContainer >
void knp::meta::load_from_container ( const std::vector< AllVariants > & from_container,
ToContainer & to_container )

Load elements from one container of all variants to another container that contains a subset of all variants.

Template Parameters
SupportedTypessubset of variants.
AllVariantsall supported variants.
ToContainertarget container.
Parameters
from_containersource container.
to_containertarget container.

Definition at line 47 of file variant_helpers.h.

◆ type_name()

template<class T >
std::string knp::meta::type_name ( )

Return type of variable as a string.

See Stack overflow.

Template Parameters
Ttype of variable.
Returns
name of a variable type.
Note
Use as type_name<decltype(variable)>().

Definition at line 47 of file specialization_helpers.h.

Variable Documentation

◆ always_false_v

template<class >
bool knp::meta::always_false_v = false
inlineconstexpr

Template used to generate a fixed false value for static asserts.

Definition at line 35 of file assert_helpers.h.