OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
olb::meta::list< TYPES > Struct Template Reference

Plain wrapper for list of types. More...

#include <meta.h>

+ Inheritance diagram for olb::meta::list< TYPES >:
+ Collaboration diagram for olb::meta::list< TYPES >:

Public Types

template<unsigned INDEX>
using get = typename std::tuple_element<INDEX, std::tuple<id<TYPES>...>>::type::type
 Returns INDEXth type of TYPES.
 
template<template< typename... > class COLLECTION>
using decompose_into = COLLECTION<TYPES...>
 Export TYPES into arbitrary variadic template COLLECTION.
 
template<template< typename > class F>
using map = list<F<TYPES>...>
 
template<typename F >
using map_to_callable_result = list<decltype(std::declval<F&>()(meta::id<TYPES>{}))...>
 
template<typename TYPE >
using push = list<TYPE, TYPES...>
 
template<typename... UYPES>
using append = list<TYPES..., UYPES...>
 
template<typename... UYPES>
using include
 Merge TYPES and UYPES into new list.
 
template<typename BASE >
using first_with_base = first_type_with_base_t<BASE, TYPES...>
 Returns first type of TYPES that is derived from BASE.
 
template<typename BASE , typename FALLBACK >
using first_with_base_or_fallback
 Returns first type of TYPES that is derived from BASE.
 

Static Public Member Functions

template<typename TYPE >
static constexpr unsigned index ()
 Index of first instance of TYPE in TYPES.
 
template<typename F >
static constexpr void for_each (F f)
 Calls f for each type of TYPES by-value (in reversed order!)
 
template<typename TYPE >
static constexpr bool contains ()
 

Static Public Attributes

static constexpr unsigned size = sizeof...(TYPES)
 

Detailed Description

template<typename... TYPES>
struct olb::meta::list< TYPES >

Plain wrapper for list of types.

Definition at line 276 of file meta.h.

Member Typedef Documentation

◆ append

template<typename... TYPES>
template<typename... UYPES>
using olb::meta::list< TYPES >::append = list<TYPES..., UYPES...>

Definition at line 300 of file meta.h.

◆ decompose_into

template<typename... TYPES>
template<template< typename... > class COLLECTION>
using olb::meta::list< TYPES >::decompose_into = COLLECTION<TYPES...>

Export TYPES into arbitrary variadic template COLLECTION.

Commonly used to instantiate data classes for a meta::list of fields

Definition at line 288 of file meta.h.

◆ first_with_base

template<typename... TYPES>
template<typename BASE >
using olb::meta::list< TYPES >::first_with_base = first_type_with_base_t<BASE, TYPES...>

Returns first type of TYPES that is derived from BASE.

Definition at line 310 of file meta.h.

◆ first_with_base_or_fallback

template<typename... TYPES>
template<typename BASE , typename FALLBACK >
using olb::meta::list< TYPES >::first_with_base_or_fallback
Initial value:
std::conditional_t<
std::is_void_v<first_with_base<BASE>>,
FALLBACK,
first_with_base<BASE>
>

Returns first type of TYPES that is derived from BASE.

If such a type doesn't exist, FALLBACK is returned.

Definition at line 317 of file meta.h.

◆ get

template<typename... TYPES>
template<unsigned INDEX>
using olb::meta::list< TYPES >::get = typename std::tuple_element<INDEX, std::tuple<id<TYPES>...>>::type::type

Returns INDEXth type of TYPES.

Definition at line 281 of file meta.h.

◆ include

template<typename... TYPES>
template<typename... UYPES>
using olb::meta::list< TYPES >::include
Initial value:
typename filter_t<neq<TYPES...>::template type, UYPES...>::template decompose_into<
list<TYPES...>::append
>
typename filter< COND, TYPES... >::type filter_t
meta::list of TYPES meeting COND
Definition meta.h:245
COLLECTION< TYPES... > decompose_into
Export TYPES into arbitrary variadic template COLLECTION.
Definition meta.h:288
list< TYPES..., UYPES... > append
Definition meta.h:300

Merge TYPES and UYPES into new list.

Definition at line 304 of file meta.h.

◆ map

template<typename... TYPES>
template<template< typename > class F>
using olb::meta::list< TYPES >::map = list<F<TYPES>...>

Definition at line 291 of file meta.h.

◆ map_to_callable_result

template<typename... TYPES>
template<typename F >
using olb::meta::list< TYPES >::map_to_callable_result = list<decltype(std::declval<F&>()(meta::id<TYPES>{}))...>

Definition at line 294 of file meta.h.

◆ push

template<typename... TYPES>
template<typename TYPE >
using olb::meta::list< TYPES >::push = list<TYPE, TYPES...>

Definition at line 297 of file meta.h.

Member Function Documentation

◆ contains()

template<typename... TYPES>
template<typename TYPE >
static constexpr bool olb::meta::list< TYPES >::contains ( )
inlinestaticconstexpr

Definition at line 336 of file meta.h.

336 {
337 return olb::meta::contains<TYPE,TYPES...>();
338 }
constexpr bool contains()
Returns true iff a given type list contains WANTED.
Definition meta.h:125

References olb::meta::contains().

+ Here is the call graph for this function:

◆ for_each()

template<typename... TYPES>
template<typename F >
static constexpr void olb::meta::list< TYPES >::for_each ( F f)
inlinestaticconstexpr

Calls f for each type of TYPES by-value (in reversed order!)

Definition at line 331 of file meta.h.

331 {
332 (f(id<TYPES>()), ...);
333 }
+ Here is the caller graph for this function:

◆ index()

template<typename... TYPES>
template<typename TYPE >
static constexpr unsigned olb::meta::list< TYPES >::index ( )
inlinestaticconstexpr

Index of first instance of TYPE in TYPES.

Definition at line 325 of file meta.h.

325 {
326 return index_of_first_matching<eq<TYPE>::template type, TYPES...>::value;
327 }
typename std::integral_constant< TYPE, VALUE >::type value
Identity type to wrap non-type template arguments.
Definition meta.h:96

Member Data Documentation

◆ size

template<typename... TYPES>
constexpr unsigned olb::meta::list< TYPES >::size = sizeof...(TYPES)
staticconstexpr

Definition at line 277 of file meta.h.


The documentation for this struct was generated from the following file: