xieite::type_list<Ts...>::apply()

Defined in fragment xieite:type_list
(header-only: <xieite/meta/type_list.hpp>)


Invokes a functor with the elements of a xieite::type_list passed as template arguments.


Declaration

static constexpr auto apply(auto&& fn)
XIEITE_ARROW(XIEITE_FWD(fn).template operator()<Ts...>())


Example

import xieite;

int main() {
	using List = xieite::type_list<int, char, float, double>;

	List::apply([]<typename... Ts> {
		xieite::dump(xieite::name<Ts>()...);
	});
}
Possible output:
int char float double
[View in Compiler Explorer]