AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
aui::parameter_pack Namespace Reference

Detailed Description

Provides an easy way to iterate over a parameter pack.

without with
template<typename Arg, typename... Args> void helperFunc(Arg&& arg, Args&&... args) {
// do something with arg
std::cout << std::forward<Arg>(arg) << std::endl;
if constexpr (sizeof...(args) > 0) {
helperFunc(std::forward<Args>(args)...); // continue iteration
}
}
template<typename... Args> void yourFunc(Args&&... args) {
helperFunc(std::forward<Args>(args)...);
}
API_AUI_CORE const ACommandLineArgs & args() noexcept
Definition OSAndroid.cpp:29
template<typename... Args> void yourFunc(Args&&... args) {
aui::parameter_pack::for_each([](auto&& i) {
// do something with arg
std::cout << i << " ";
}, std::forward<Args>(args)...);
}

Typedefs

template<typename... Types>
using first = typename impl::first<Types...>::type