16#ifndef TEMPLATEUTILS_H
17#define TEMPLATEUTILS_H
19namespace open_cpp_utils
32template<
typename T, T V>
36 static constexpr type value = V;
38 constexpr operator type()
const noexcept {
return value; }
39 [[nodiscard]]
constexpr type operator()()
const {
return value; }
55template<
typename,
typename>
56inline static constexpr bool is_same =
false_type{};
62inline static constexpr bool is_same<T, T> = true_type{};
68template<
typename...Ts>
69inline static constexpr bool is_unique =
true_type{};
71template<
typename T,
typename...Ts>
72inline constexpr bool is_unique<T, Ts...> =
bool_constant<(!is_same<T, Ts> && ...) && is_unique<Ts...>>{};
Compile-time constant value.
Definition template_utils.h:34
constant_value< bool, V > bool_constant
Compile-time constant boolean value.
Definition template_utils.h:47
bool_constant< true > true_type
Constant True value.
Definition template_utils.h:49