Skip to content

CoMeta


array_ref class

template <typename T> array_ref

Reference to array


b8 typedef

b8 = bool

Short names for common types


choose_const function

template <typename T, typename C1, typename... Cs,
          CMT_ENABLE_IF(std::is_same_v<T, C1>)>
constexpr T choose_const(C1 c1, Cs...)

Selects constant of the specific type

CHECK( choose_const<f32\>( 32.0f, 64.0 ) == 32.0f );
CHECK( choose_const<f64\>( 32.0f, 64.0 ) == 64.0 );


ctypeid function

template <typename T> constexpr inline type_id_t ctypeid()

Gets unique value associated with the type
Template param T type
Returns value of type that supports operator== and operator!=


template <typename T>
constexpr inline type_id_t ctypeid(T x)

Gets unique value associated with the type
Param x value of specific type
Returns value of type that supports operator== and operator!=


datatype enum

enum class datatype : int

An enumeration representing data type


function class

template <typename F> function

std::function-like lightweight function wrapper

function<int( float )\> f = []( float x ){ return static_cast<int\>( x ); };
CHECK( f( 3.4f ) == 3 )


gcd function

template <typename T> constexpr T gcd(T a)

Greatest common divisor


template <typename T> constexpr inline T gcd(T a, T b)

Greatest common divisor


template <typename T, typename... Ts>
constexpr T gcd(T a, T b, T c, Ts... rest)

Greatest common divisor


get_first function

template <typename T1, typename... Ts>
constexpr T1 &&get_first(T1 &&x, Ts &&...) CMT_NOEXCEPT

Function that returns its first argument and ignores all other arguments


get_second function

template <typename T1, typename T2, typename... Ts>
constexpr T2 &&get_second(T1, T2 &&x, Ts &&...) CMT_NOEXCEPT

Function that returns its second argument and ignores all other arguments


get_third function

template <typename T1, typename T2, typename T3,
          typename... Ts>
constexpr T3 &&get_third(T1 &&, T2 &&, T3 &&x,
                         Ts &&...) CMT_NOEXCEPT

Function that returns its third argument and ignores all other arguments


identity typedef

template <typename T>
identity = typename details::identity_impl<T>::type

Utility typedef used to disable type deduction


identity = typename details::identity_impl<T>::type

Utility typedef used to disable type deduction


is_numeric variable

template <typename T>
constexpr inline bool is_numeric =
    is_number<deep_subtype<T>>

Check if the type argument is a number or a vector of numbers


is_numeric_args variable

template <typename... Ts>
constexpr inline bool is_numeric_args =
    (is_numeric<Ts> && ...)

Check if the type arguments are a numbers or a vectors of numbers


is_numeric_or_bool variable

template <typename T>
constexpr inline bool is_numeric_or_bool =
    is_number_or_bool<deep_subtype<T>>

Check if the type argument is a number, bool or a vector of numbers of bool


lcm function

template <typename T> constexpr T lcm(T a)

Least common multiple


template <typename T> constexpr T lcm(T a, T b)

Least common multiple


template <typename T, typename... Ts>
constexpr T lcm(T a, T b, T c, Ts... rest)

Least common multiple


make_range function

template <typename T>
constexpr range<T> make_range(T begin, T end)

Make iterable range object


template <typename T, typename D>
constexpr range<std::common_type_t<T, D>>
make_range(T begin, T end, D step)

Make iterable range object with step


next_poweroftwo function

template <typename T> constexpr T next_poweroftwo(T n)

Returns a nearest power of two that is greater or equal than n


noop function

template <typename... Ts>
constexpr void noop(Ts &&...) CMT_NOEXCEPT

Function that returns void and ignores all its arguments


pass_through function

template <typename T>
constexpr T &&pass_through(T &&x) CMT_NOEXCEPT

Function that returns its first argument


prev_poweroftwo function

template <typename T> constexpr T prev_poweroftwo(T n)

Returns a nearest power of two that is less or equal than n


range class

template <typename T> range

Iterable range


return_constant function

template <typename T, T value, typename... Args>
constexpr T return_constant(Args &&...)

Function that returns constant of type T and ignores all its arguments


returns function

template <typename T, typename... Ts>
constexpr T returns(Ts &&...)

Function that returns value-initialization of type T and ignores all its arguments


swallow class

swallow

Utility class to use in list-initialization context


swallow

Utility class to use in list-initialization context


type_name function

template <typename T>
inline const char *type_name() CMT_NOEXCEPT

Gets the fully qualified name of the type, including namespace and template parameters (if any)
Template param T type
Returns name of the type


template <typename T>
inline const char *type_name(T x) CMT_NOEXCEPT

Gets the fully qualified name of the type, including namespace and template parameters (if any)
Param x value of specific type
Returns name of the type


Auto-generated from sources, Revision 5191a48df06ea47104ca67db19fa82058d09c20a, https://github.com/kfrlib/kfr/blob/5191a48df06ea47104ca67db19fa82058d09c20a/include/kfr/