xentara-utils v2.0.4
The Xentara Utility Library
Loading...
Searching...
No Matches
xentara::utils::tools::ParameterPack< Parameters > Struct Template Reference

A marker for a pack of parameters. More...

#include <xentara/utils/tools/ParameterPack.hpp>

Public Types

using First = typename Splitter< Parameters... >::First
 Type alias for the first type in Parameters.
 
using Next = typename Splitter< Parameters... >::Next
 Type alias for a parameter pack with one less parameter.
 

Static Public Member Functions

static constexpr auto empty () noexcept -> bool
 Determines if the parameter pack is empty.
 
static consteval auto self () noexcept -> ParameterPack
 An object of this type.
 
static consteval auto next () noexcept -> Next
 A parameter pack with one less parameter.
 

Detailed Description

template<typename... Parameters>
struct xentara::utils::tools::ParameterPack< Parameters >

A marker for a pack of parameters.

This is an empty class that can be used in meta programming to represent a parameter pack. It is used in a similar way to std::in_place_type_t: it can be passed to a function to select an overload that uses a certain pack of parameter templates.

Member Typedef Documentation

◆ First

template<typename... Parameters>
using xentara::utils::tools::ParameterPack< Parameters >::First = typename Splitter<Parameters...>::First

Type alias for the first type in Parameters.

Precondition
This type alias does not exist if Parameters is empty.

◆ Next

template<typename... Parameters>
using xentara::utils::tools::ParameterPack< Parameters >::Next = typename Splitter<Parameters...>::Next

Type alias for a parameter pack with one less parameter.

This type alias can be used for recursive templates to access the next iteration in the recursion. It represents a parameter pack that has the same parameters, but with First removed.

Precondition
This type alias does not exist if Parameters is empty.

Member Function Documentation

◆ empty()

template<typename... Parameters>
static constexpr auto xentara::utils::tools::ParameterPack< Parameters >::empty ( ) -> bool
staticconstexprnoexcept

Determines if the parameter pack is empty.

Returns
Returns true if Parameters is an empty pack, or false if it contains at least one type.

◆ next()

template<typename... Parameters>
consteval auto xentara::utils::tools::ParameterPack< Parameters >::next ( ) -> Next
staticnoexcept

A parameter pack with one less parameter.

This is an object of type Next. It can be used for recursive templates to access the next iteration in the recursion. The object is a parameter pack that has the same parameters, but with First removed.

Precondition
This member variable does not exist if Parameters is empty.

◆ self()

template<typename... Parameters>
consteval auto xentara::utils::tools::ParameterPack< Parameters >::self ( ) -> ParameterPack
staticnoexcept

An object of this type.

This is the same as kParameterPack<Parameters...>. You can use this constant if you need to access an object using the type of the ParameterPack specialization instead of the actual parameter pack.