Skip to content

Commit d929be1

Browse files
committed
Remove now-redundant checks for boolean types in various concepts
1 parent e90974e commit d929be1

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

fly/types/bit_stream/detail/bit_stream_concepts.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ namespace fly::detail {
1212
* Concept that is satisfied if the given type is an unsigned integral type.
1313
*/
1414
template <typename T>
15-
concept BitStreamInteger =
16-
fly::UnsignedIntegral<std::remove_cvref_t<T>> && !std::same_as<std::remove_cvref_t<T>, bool>;
15+
concept BitStreamInteger = fly::UnsignedIntegral<T>;
1716

1817
/**
1918
* Concept that is satisfied if the given type is the bit stream buffer type.

fly/types/json/json_concepts.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ concept JsonBoolean = std::same_as<std::remove_cvref_t<T>, json_boolean_type>;
121121
* Concept that is satisfied when the given type is a signed JSON number type.
122122
*/
123123
template <typename T>
124-
concept JsonSignedInteger = fly::SignedIntegral<std::remove_cvref_t<T>> && !JsonBoolean<T>;
124+
concept JsonSignedInteger = fly::SignedIntegral<T>;
125125

126126
/**
127127
* Concept that is satisfied when the given type is an unsigned JSON number type.
128128
*/
129129
template <typename T>
130-
concept JsonUnsignedInteger = fly::UnsignedIntegral<std::remove_cvref_t<T>> && !JsonBoolean<T>;
130+
concept JsonUnsignedInteger = fly::UnsignedIntegral<T>;
131131

132132
/**
133133
* Concept that is satisfied when the given type is a JSON floating-point number type.
134134
*/
135135
template <typename T>
136-
concept JsonFloatingPoint = fly::FloatingPoint<std::remove_cvref_t<T>>;
136+
concept JsonFloatingPoint = fly::FloatingPoint<T>;
137137

138138
/**
139139
* Concept that is satisfied when the given type is a JSON number type.

fly/types/numeric/detail/endian_concepts.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ namespace fly::detail {
1414
template <typename T>
1515
concept EndianInteger = requires
1616
{
17-
requires std::is_integral_v<std::remove_cvref_t<T>>;
18-
19-
requires !std::same_as<std::remove_cvref_t<T>, bool>;
17+
requires fly::Integral<T>;
2018

2119
requires fly::SizeOfTypeIs<T, 1> || fly::SizeOfTypeIs<T, 2> || fly::SizeOfTypeIs<T, 4> ||
2220
fly::SizeOfTypeIs<T, 8>;

fly/types/string/detail/string_concepts.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ concept FormattableBoolean = std::same_as<bool, std::remove_cvref_t<T>>;
6565
* types.
6666
*/
6767
template <typename T>
68-
concept FormattableIntegral = std::is_integral_v<std::remove_cvref_t<T>> && !FormattableBoolean<T>;
68+
concept FormattableIntegral = fly::Integral<T>;
6969

7070
/**
7171
* Concept that is satisfied when the given type is a formattable floating-point type.
7272
*/
7373
template <typename T>
74-
concept FormattableFloatingPoint = std::is_floating_point_v<std::remove_cvref_t<T>>;
74+
concept FormattableFloatingPoint = fly::FloatingPoint<T>;
7575

7676
/**
7777
* Concept that is satisfied when the given type is a formattable user-defined type.

0 commit comments

Comments
 (0)