Skip to content

type_list

#include <xalgospp/parameters.hh>
template<typename... Ts>
struct type_list

Defined in src/lib/xalgospp/parameters.hh:60

Simple type-list for compile-time listing of inputs/outputs.

Versus the ncarray type list, this one also provides a size accessor.

Name Kind Owner
accepts variable Declared here
index_of variable Declared here
accepts_when_paired variable Declared here
size function Declared here
type_at typedef Declared here
Return Name Description
constexpr bool accepts static constexpr Evaluates true if the type U is in the type list.
constexpr hd_std::ptrdiff_t index_of static constexpr Retrieve the index N of a type from the list given the type.
constexprbool accepts_when_paired static constexpr Evalutes true if type U is accepted, and type V is in its list at the same index.

static constexpr

constexpr bool accepts =
(sizeof...(Ts) == 0) ||
( (hd_std::is_same_v<hd_std::decay_t<U>, hd_std::decay_t<Ts>> ||
hd_std::is_convertible_v<hd_std::decay_t<U>, hd_std::decay_t<Ts>>) ||
...)

Defined in src/lib/xalgospp/parameters.hh:93

Evaluates true if the type U is in the type list.


static constexpr

constexpr hd_std::ptrdiff_t index_of = (sizeof...() == 0)
? -1
: <, 0, Ts...>::value

Defined in src/lib/xalgospp/parameters.hh:109

Retrieve the index N of a type from the list given the type.


static constexpr

constexprbool accepts_when_paired = []() {
(sizeof...() == 0 || OtherList::size() == 0) {
;
} {
{ <> };
( < 0 || >= <hd_std::ptrdiff_t>(OtherList::size())) {
;
} {
=
OtherList::template <<hd_std::size_t>()>;
hd_std::is_same_v<hd_std::decay_t<>, hd_std::decay_t<>> ||
hd_std::is_convertible_v<hd_std::decay_t<>, hd_std::decay_t<>>;
}
}
}()

Defined in src/lib/xalgospp/parameters.hh:121

Evalutes true if type U is accepted, and type V is in its list at the same index.

This allows enforcement of strict ordering between two type_lists, where the checking of types requires that both types are in their respective lists, and that they appear in the same position.

Return Name Description
XALG_HDconstexpr hd_std::size_t size static inline constexpr Returns the length of the type list, i.e., the number of types.

static inline constexpr

constexpr static inline XALG_HDconstexpr hd_std::size_t size()

Defined in src/lib/xalgospp/parameters.hh:87

Returns the length of the type list, i.e., the number of types.

The length of the type list.

Name Description
type_at Access the Nth type from the list.

using type_at = typename hd_std::tuple_element< N, hd_std::tuple< Ts... > >::type

Defined in src/lib/xalgospp/parameters.hh:103

Access the Nth type from the list.