xieite::as<>

Defined in header <xieite/fn/as.hpp>

A functor for casting something implicitly.


Declaration

template<typename T>
constexpr auto as =
	[][[nodiscard]](std::type_identity_t<T> x) static
		XIEITE_ARROW(x);


Example

int main() {
	int x = 5;
	auto y = xieite::as<double>(x);
	xieite::dump(y);
}
Output:
5
[View in Compiler Explorer]