PrevUpHomeNext

kpp::one_of


---- kpp::one_of << Basic Concepts << Type System << Kpp c++ ----

kpp::one_of is a c++ concept of kpp c++ library. kpp::one_of is used for constraint that a type is any one of a list of types.

kpp::one_of is used to design the kpp basic types, by picking a specific type from a list of types, if no type is satisfied, the trait returns kpp::overflow_type. It can be used for general purpose too.

kpp::one_of Sig:

template <typename type_t00, typename ... type_list>
concept one_of = ...;

include

#include <kpp/types.hpp>

c++ example

#include <kpp/types.hpp>

template <kpp::one_of<int, float, char> type_t00>
class test
{
};

int main()
{
	auto obj = test<int>{};
	// test<int &>{};	// failed
}

See Also

kpp::not_one_of

kpp::same_as

kpp::same_assert

Back

Up










Deck

Kpp Home


PrevUpHomeNext