10 using integer_types_t =
17 stream <<
"is int in integer_types_t ? "
18 << types::is_in_list_v<int, integer_types_t> <<
endl;
20 stream <<
"is int in real_types_t ? "
21 << types::is_in_list_v<int, real_types_t> <<
endl;
24 stream <<
"is float in integer_types_t ? "
25 << types::is_in_list_v<float, integer_types_t> <<
endl;
27 stream <<
"is float in real_types_t ? "
28 << types::is_in_list_v<float, real_types_t> <<
endl;
32template<
typename Type,
typename... Types>
35template<
typename Type>
42template<
typename Type>
46 long long q = (
long long) n/d;
53 stream <<
"The remainder of 7.0 divided by 4.0 is "
56 stream <<
"The remainder of 7 divided by 4 is "
61template<
typename Type>
65 int, unsigned, long,
unsigned long,
long long,
unsigned long long>;
70 if constexpr(types::is_in_list_v<Type, integral_types>)
74 else if constexpr(types::is_in_list_v<Type, real_types>)
76 long long q = (
long long) n / d;
81 static_assert(types::is_in_list_v<Type, real_types>
82 || types::is_in_list_v<Type, integral_types>,
"Type should be either integral of floating-point type");
89 stream <<
"The remainder of 7.0 divided by 4.0 is "
92 stream <<
"The remainder of 7 divided by 4 is "
typename enable_if< predicate, ReturnType >::type enable_if_t
void test_what_is_type_list()
std::enable_if_t< types::is_in_list_v< Type, Types... >, Type > enable_if_in_types_t
Type remainder_fn(Type n, Type d)
enable_if_in_types_t< Type, short, unsigned short, int, unsigned, long, unsigned long, long long, unsigned long long > remainder(Type n, Type d)
constexpr bool is_in_list_v
Type to string name conversions are defined.
This type is used to manipulate type list.
Stream output operators << are implemented.