smgl 0.11.0
Structured Metadata Engine and Graph Objects Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
smgl::detail::ExpandType Struct Reference

Helper class for calling function iteratively on parameter pack. More...

#include <smgl/Utilities.hpp>

Public Member Functions

template<typename... T>
 ExpandType (T &&...)
 

Detailed Description

Helper class for calling function iteratively on parameter pack.

Used until C++17, which includes parameter pack folding. See: https://stackoverflow.com/a/17340003

// C++17 built-in folding expression
template<typename... Ts>
void CallFooOnAll(Ts&&... ts) {
(foo(std::forward<Ts>(ts)), ...);
}
// C++11 "folding" using ExpandType
template<typename... Ts>
void CallFooOnAll(Ts&&... ts) {
ExpandType{0, (foo(std::forward<Ts>(ts)), 0)...}
}
T make_shared(T... args)
Helper class for calling function iteratively on parameter pack.
Definition Utilities.hpp:37

Definition at line 37 of file Utilities.hpp.

Constructor & Destructor Documentation

◆ ExpandType()

template<typename... T>
smgl::detail::ExpandType::ExpandType ( T &&  ...)
explicit

Constructor

Definition at line 13 of file UtilitiesImpl.hpp.


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