PrevUpHomeNext

kpp::same_v_assert


---- kpp::same_v_assert << Basic Utils << Type System << Kpp c++ ----

kpp::same_v_assert is a c++ class of kpp c++ library.

kpp::same_v_assert asserts two values are both the same type and the same value.

AKA. kpp::same_v_assert <====> static_assert + kpp::same_as + value-equality.

Note that the two types must be exactly the same.

kpp::same_assert usage Sig:

kpp::same_assert<value1, value2>{};
kpp::same_assert<value1, value2, true>{};
kpp::same_assert<value1, value2, false>{};

true by default.

include

#include <kpp/types.hpp>

c++ example

#include <kpp/types.hpp>

int main()
{
	kpp::same_v_assert<7, 2+5>{};
	kpp::same_v_assert<7, 7u, false>{};
}

See Also

kpp::bare_same_v_assert

kpp::same_assert

kpp::same_as

Back

Up










Deck

Kpp Home


PrevUpHomeNext