qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches

Utility for forcing parameter pack expansion in certain contexts. More...

#include <type_traits.h>

Public Member Functions

template<typename... U>
 expand (U const &...)
 Constructor that expands a parameter pack.

Detailed Description

Utility for forcing parameter pack expansion in certain contexts.

The constructor takes a variadic pack of arguments. This is useful when you need to perform an operation on each element of a pack, often using a comma operator inside an initializer list or braced-init-list for the constructor call.

// template<typename... Args>
// void print_all(Args... args) {
// qb::expand{ (std::cout << args << std::endl, 0)... };
// }

Constructor & Destructor Documentation

◆ expand()

template<typename... U>
qb::expand::expand ( U const & ...)
inline

Constructor that expands a parameter pack.

Takes an arbitrary number of arguments of any type and does nothing with them. This is used purely for the side effect of expanding the parameter pack.

Template Parameters
UTypes of parameters in the pack
Parameters
...Parameters to expand (not used)