File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ namespace msgpack23 {
113
113
template <typename T>
114
114
concept VariantLike = is_variant_v<T>;
115
115
116
- template <typename T, std::enable_if_t <std::is_integral_v<T>, int > = 0 >
116
+ template <std::integral T >
117
117
[[nodiscard]] constexpr T to_big_endian (T const value) noexcept {
118
118
if constexpr (std::endian::native == std::endian::little) {
119
119
return std::byteswap (value);
@@ -122,13 +122,9 @@ namespace msgpack23 {
122
122
}
123
123
}
124
124
125
- template <typename T, std::enable_if_t <std::is_integral_v<T>, int > = 0 >
125
+ template <std::integral T >
126
126
[[nodiscard]] constexpr T from_big_endian (T const value) noexcept {
127
- if constexpr (std::endian::native == std::endian::little) {
128
- return std::byteswap (value);
129
- } else {
130
- return value;
131
- }
127
+ return to_big_endian (value);
132
128
}
133
129
134
130
class Packer {
You can’t perform that action at this time.
0 commit comments