@@ -84,7 +84,9 @@ consteval auto get_range_min() {
8484 if constexpr (_is_flag) {
8585 return 0 ;
8686 } else {
87- return std::max (std::numeric_limits<U>::min (), range_min<T>::value);
87+ return std::max (static_cast <decltype (range_min<T>::value)>(
88+ std::numeric_limits<U>::min ()),
89+ range_min<T>::value);
8890 }
8991}
9092template <class T , bool _is_flag>
@@ -97,7 +99,9 @@ consteval auto get_range_max() {
9799 return (sizeof (U) * 8 - 1 );
98100 }
99101 } else {
100- return std::min (std::numeric_limits<U>::max (), range_max<T>::value);
102+ return std::min (static_cast <decltype (range_max<T>::value)>(
103+ std::numeric_limits<U>::max ()),
104+ range_max<T>::value);
101105 }
102106}
103107
@@ -126,7 +130,8 @@ consteval auto operator|(Names<EnumType, LiteralType, N, _is_flag, _enums...>,
126130 }
127131}
128132
129- template <class EnumType , class LiteralType , size_t N, bool _is_flag, auto ... _enums>
133+ template <class EnumType , class LiteralType , size_t N, bool _is_flag,
134+ auto ... _enums>
130135struct NamesCombiner {
131136 template <int ... Is>
132137 static consteval auto combine (std::integer_sequence<int , Is...>) {
@@ -145,8 +150,10 @@ struct CombineNames {
145150 }(std::make_integer_sequence<int , End - Start + 1 >{});
146151 } else {
147152 constexpr int Mid = Start + (End - Start) / 2 ;
148- constexpr auto left = CombineNames<ChunkSize>::template apply<NamesType, Start, Mid>();
149- constexpr auto right = CombineNames<ChunkSize>::template apply<NamesType, Mid + 1 , End>();
153+ constexpr auto left =
154+ CombineNames<ChunkSize>::template apply<NamesType, Start, Mid>();
155+ constexpr auto right =
156+ CombineNames<ChunkSize>::template apply<NamesType, Mid + 1 , End>();
150157 return left | right;
151158 }
152159 }
@@ -155,16 +162,18 @@ struct CombineNames {
155162template <class EnumType , bool _is_flag>
156163consteval auto get_enum_names () {
157164 static_assert (is_scoped_enum<EnumType>,
158- " You must use scoped enums (using class or struct) for the parsing to work!" );
165+ " You must use scoped enums (using class or struct) for the "
166+ " parsing to work!" );
159167 static_assert (std::is_integral_v<std::underlying_type_t <EnumType>>,
160- " The underlying type of any Enum must be integral!" );
168+ " The underlying type of any Enum must be integral!" );
161169
162170 constexpr auto max = get_range_max<EnumType, _is_flag>();
163171 constexpr auto min = get_range_min<EnumType, _is_flag>();
164172 constexpr auto range_size = max - min + 1 ;
165173
166174 static_assert (range_size > 0 ,
167- " enum_range requires a valid range size. Ensure that max is greater than min." );
175+ " enum_range requires a valid range size. Ensure that max is "
176+ " greater than min." );
168177
169178 using EmptyNames = Names<EnumType, rfl::Literal<" " >, 0 , _is_flag>;
170179
0 commit comments