PrevUpHomeNext

utx::mean_v


utx::mean_v

utx::mean_v is similar to utx::mean_t, but it returns a related value for a condition.

Calling sig:

template <bool condition, auto result1, auto result2>
constexpr auto mean_v = ???;

If condition is true, result is result1; if condition is false, result is result2.

Include

#include <utxcpp/core.hpp>

c++ example

#include <utxcpp/core.hpp>

int main()
{
	static_assert(utx::mean_v<true, 123, 321.123> == 123);
	static_assert(utx::mean_v<false, 123, 321.123> == 321.123);
}

See Also

utx::mean_t

Last revised: February 24, 2024 at 08:57:24 GMT


PrevUpHomeNext