cmoon::meta::type_list<Types...>::for_each
|
(1) |
Runs the given function for each type as such:
std::invoke(Function<T>{})
for each T
in Types...
.
Parameters
(none)
Return value
(none)
Exceptions
1) noexcept specification:
noexcept(std::conjunction_v<std::is_nothrow_invocable<Function<Types>>...>)
Complexity
Constant.
Example
import <type_traits>;
import <iostream>;
import cmoon.meta;
template<class T>
struct print_type
{
void operator()() const
{
std::cout << typeid(T).name() << ' ';
}
};
int main()
{
using tl = cmoon::meta::type_list<float, double, long double>;
tl::for_each<print_type>();
}