Skip to content

Commit f6ef3e8

Browse files
committed
fix new clang -Wdeprecated-literal-operator (no whitespace between "" and _)
1 parent 3d1d4fc commit f6ef3e8

File tree

4 files changed

+163
-157
lines changed

4 files changed

+163
-157
lines changed

include/tao/json/binary.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ namespace tao::json
1919
{
2020
namespace internal
2121
{
22-
[[nodiscard]] constexpr char unhex_char( const char c ) noexcept
22+
[[nodiscard]] constexpr char unhex_char(const char c) noexcept
2323
{
24-
return static_cast< char >( ( c < 'A' ) ? ( c - '0' ) : ( ( c < 'a' ) ? ( c - 'A' + 10 ) : ( c - 'a' + 10 ) ) );
24+
return static_cast<char>((c < 'A') ? (c - '0') : ((c < 'a') ? (c - 'A' + 10) : (c - 'a' + 10)));
2525
}
2626

2727
template< typename V, V... >
@@ -43,7 +43,7 @@ namespace tao::json
4343
struct unhex_helper< T, vlist< V, Vs... >, C >
4444
: unhex_helper< T, vlist< V > >
4545
{
46-
static_assert( internal::dependent_false< T >, "digits must occur in pairs" );
46+
static_assert(internal::dependent_false< T >, "digits must occur in pairs");
4747
};
4848

4949
template< typename T, typename V, V... Vs, char C1, char... Cs >
@@ -56,27 +56,27 @@ namespace tao::json
5656
struct unhex_helper< T, vlist< V, Vs... >, C0, '\'', Cs... >
5757
: unhex_helper< T, vlist< V > >
5858
{
59-
static_assert( internal::dependent_false< T >, "digit separator only allowed between pairs of digits" );
59+
static_assert(internal::dependent_false< T >, "digit separator only allowed between pairs of digits");
6060
};
6161

6262
template< typename T, typename V, V... Vs, char C0, char C1, char... Cs >
6363
struct unhex_helper< T, vlist< V, Vs... >, C0, C1, Cs... >
64-
: unhex_helper< T, vlist< V, Vs..., V( ( unhex_char( C0 ) << 4 ) + unhex_char( C1 ) ) >, Cs... >
64+
: unhex_helper< T, vlist< V, Vs..., V((unhex_char(C0) << 4) + unhex_char(C1)) >, Cs... >
6565
{
6666
};
6767

6868
template< typename T, typename V, char C >
6969
[[nodiscard]] constexpr T unhex()
7070
{
71-
static_assert( internal::dependent_false< T >, "not a hex literal" );
71+
static_assert(internal::dependent_false< T >, "not a hex literal");
7272
return T{};
7373
}
7474

7575
template< typename T, typename V, char C0, char C1, char... Cs >
7676
[[nodiscard]] constexpr T unhex()
7777
{
78-
static_assert( C0 == '0', "not a hex literal" );
79-
static_assert( C1 == 'x' || C1 == 'X', "not a hex literal" );
78+
static_assert(C0 == '0', "not a hex literal");
79+
static_assert(C1 == 'x' || C1 == 'X', "not a hex literal");
8080
return unhex_helper< T, vlist< V >, Cs... >::unhex();
8181
}
8282

@@ -91,7 +91,7 @@ namespace tao::json
9191
inline namespace literals
9292
{
9393
template< char... Cs >
94-
[[nodiscard]] std::vector< std::byte > operator"" _binary()
94+
[[nodiscard]] std::vector< std::byte > operator""_binary()
9595
{
9696
return internal::unhex< std::vector< std::byte >, Cs... >();
9797
}

include/tao/json/from_string.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@
1414
namespace tao::json
1515
{
1616
template< template< typename... > class Traits, template< typename... > class... Transformers, typename... Ts >
17-
[[nodiscard]] basic_value< Traits > basic_from_string( Ts&&... ts )
17+
[[nodiscard]] basic_value< Traits > basic_from_string(Ts&&... ts)
1818
{
1919
events::transformer< events::to_basic_value< Traits >, Transformers... > consumer;
20-
events::from_string( consumer, std::forward< Ts >( ts )... );
21-
return std::move( consumer.value );
20+
events::from_string(consumer, std::forward< Ts >(ts)...);
21+
return std::move(consumer.value);
2222
}
2323

2424
template< template< typename... > class... Transformers, typename... Ts >
25-
[[nodiscard]] value from_string( Ts&&... ts )
25+
[[nodiscard]] value from_string(Ts&&... ts)
2626
{
27-
return basic_from_string< traits, Transformers... >( std::forward< Ts >( ts )... );
27+
return basic_from_string< traits, Transformers... >(std::forward< Ts >(ts)...);
2828
}
2929

3030
inline namespace literals
3131
{
32-
[[nodiscard]] inline value operator"" _json( const char* data, const std::size_t size )
32+
[[nodiscard]] inline value operator""_json(const char* data, const std::size_t size)
3333
{
34-
return json::from_string( data, size, "literal" );
34+
return json::from_string(data, size, "literal");
3535
}
3636

3737
} // namespace literals

include/tao/json/jaxn/from_string.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@
1515
namespace tao::json::jaxn
1616
{
1717
template< template< typename... > class Traits, template< typename... > class... Transformers, typename... Ts >
18-
[[nodiscard]] basic_value< Traits > basic_from_string( Ts&&... ts )
18+
[[nodiscard]] basic_value< Traits > basic_from_string(Ts&&... ts)
1919
{
2020
json::events::transformer< json::events::to_basic_value< Traits >, Transformers... > consumer;
21-
events::from_string( consumer, std::forward< Ts >( ts )... );
22-
return std::move( consumer.value );
21+
events::from_string(consumer, std::forward< Ts >(ts)...);
22+
return std::move(consumer.value);
2323
}
2424

2525
template< template< typename... > class... Transformers, typename... Ts >
26-
[[nodiscard]] value from_string( Ts&&... ts )
26+
[[nodiscard]] value from_string(Ts&&... ts)
2727
{
28-
return basic_from_string< traits, Transformers... >( std::forward< Ts >( ts )... );
28+
return basic_from_string< traits, Transformers... >(std::forward< Ts >(ts)...);
2929
}
3030

3131
inline namespace literals
3232
{
33-
[[nodiscard]] inline value operator"" _jaxn( const char* data, const std::size_t size )
33+
[[nodiscard]] inline value operator""_jaxn(const char* data, const std::size_t size)
3434
{
35-
return jaxn::from_string( data, size, "literal" );
35+
return jaxn::from_string(data, size, "literal");
3636
}
3737

3838
} // namespace literals

0 commit comments

Comments
 (0)