Type Pack 0.0.1
Loading...
Searching...
No Matches
API Overview

ty::pack

Provides a wrapper for a type template parameter pack.

A wrapper for a type template parameter pack.
Definition typack.hpp:13

Types (Transforms)

ty::pack::concat_t

Adds types to the end of a pack.

static_assert(std::is_same_v<
>);

ty::pack::concat_t will also unwrap inner packs.

ty::pack::filter_t

Filters the types in a pack so that only those matching a given type trait remain.

static_assert(std::is_same_v<
>);

ty::pack::map_t

Transforms all types in a pack using a type modifier.

static_assert(std::is_same_v<
>);

ty::pack::into_t

Unwraps the pack types into another tuple-like template.

static_assert(std::is_same_v<
std::tuple<char, float, int>
>);

Values

ty::pack::any_v

Provides a static boolean constant indicating whether any of the types in a pack match a given type trait.

static_assert(ty::pack<int, double>::any_v<std::is_floating_point> == true);
static_assert(ty::pack<char, int>::any_v<std::is_floating_point> == false);
// Empty pack any_v returns false
static_assert(ty::pack<>::any_v<std::is_integral> == false);

ty::pack::all_v

Provides a static boolean constant indicating whether all of the types in a pack match a given type trait.

static_assert(ty::pack<float, double>::any_v<std::is_floating_point> == true);
static_assert(ty::pack<int, double>::all_v<std::is_floating_point> == false);
// Empty pack all_v returns true
static_assert(ty::pack<>::all_v<std::is_integral> == true);

ty::pack::size

Provides the size of the pack.

static_assert(ty::pack<char, int>::size == 2);

ty::empty_t

Provides an empty pack (same as ty::pack<>).