xte::type<>

Defined in header <xte/meta/type.hpp>

Turns a type into a "simple" type. Useful for declaring C-style array or function parameters.
Differs from std::type_identity_t<> in that this does not prevent template parameter deduction (see example).


Declaration

template<typename T>
using type = T;


Example

template<typename Return>
void foo(xte::type<Return()>& func) {
	func();
}

int bar() {
	std::println("bar");
	return 0;
}

double qux() {
	std::println("qux");
	return 0.0;
}

int main() {
	foo(bar);
	foo(qux);
}
Output:
bar
qux
[View in Compiler Explorer]