Skip to content

Commit 24946f6

Browse files
committed
🚨 fixed some more linter warnings
1 parent 7d0dc10 commit 24946f6

File tree

5 files changed

+42
-42
lines changed

5 files changed

+42
-42
lines changed

include/nlohmann/adl_serializer.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace nlohmann
99
{
10+
1011
template<typename, typename>
1112
struct adl_serializer
1213
{
@@ -16,14 +17,13 @@ struct adl_serializer
1617
This function is usually called by the `get()` function of the
1718
@ref basic_json class (either explicit or via conversion operators).
1819
19-
@param[in] j JSON value to read from
20+
@param[in] j JSON value to read from
2021
@param[in,out] val value to write to
2122
*/
2223
template<typename BasicJsonType, typename ValueType>
2324
static auto from_json(BasicJsonType&& j, ValueType& val) noexcept(
24-
noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val))) -> decltype(
25-
::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void()
26-
)
25+
noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)))
26+
-> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
2727
{
2828
::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
2929
}
@@ -35,15 +35,15 @@ struct adl_serializer
3535
class.
3636
3737
@param[in,out] j JSON value to write to
38-
@param[in] val value to read from
38+
@param[in] val value to read from
3939
*/
4040
template <typename BasicJsonType, typename ValueType>
4141
static auto to_json(BasicJsonType& j, ValueType&& val) noexcept(
4242
noexcept(::nlohmann::to_json(j, std::forward<ValueType>(val))))
43-
-> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)),
44-
void())
43+
-> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)), void())
4544
{
4645
::nlohmann::to_json(j, std::forward<ValueType>(val));
4746
}
4847
};
48+
4949
} // namespace nlohmann

include/nlohmann/detail/json_pointer.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class json_pointer
5959
6060
@since version 2.0.0
6161
*/
62-
std::string to_string() const noexcept
62+
std::string to_string() const
6363
{
6464
return std::accumulate(reference_tokens.begin(), reference_tokens.end(),
6565
std::string{},
@@ -114,7 +114,7 @@ class json_pointer
114114
}
115115

116116
/// return whether pointer points to the root document
117-
bool is_root() const
117+
bool is_root() const noexcept
118118
{
119119
return reference_tokens.empty();
120120
}
@@ -566,7 +566,7 @@ class json_pointer
566566
{}
567567
}
568568

569-
/// escape "~"" to "~0" and "/" to "~1"
569+
/// escape "~" to "~0" and "/" to "~1"
570570
static std::string escape(std::string s)
571571
{
572572
replace_substring(s, "~", "~0");

include/nlohmann/detail/macro_scope.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
/*!
9191
@brief macro to briefly define a mapping between an enum and JSON
92-
@macro NLOHMANN_JSON_SERIALIZE_ENUM
92+
@def NLOHMANN_JSON_SERIALIZE_ENUM
9393
@since version 3.4.0
9494
*/
9595
#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \

include/nlohmann/json.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,7 +3405,7 @@ class basic_json
34053405

34063406
/*!
34073407
@brief overload for a default value of type const char*
3408-
@copydoc basic_json::value(const typename object_t::key_type&, ValueType) const
3408+
@copydoc basic_json::value(const typename object_t::key_type&, const ValueType&) const
34093409
*/
34103410
string_t value(const typename object_t::key_type& key, const char* default_value) const
34113411
{
@@ -6673,9 +6673,10 @@ class basic_json
66736673
@complexity Linear in the size of the JSON value @a j.
66746674
66756675
@sa http://bsonspec.org/spec.html
6676-
@sa @ref from_bson(detail::input_adapter, const bool strict) for the
6676+
@sa @ref from_bson(detail::input_adapter&&, const bool strict) for the
66776677
analogous deserialization
6678-
@sa @ref to_ubjson(const basic_json&) for the related UBJSON format
6678+
@sa @ref to_ubjson(const basic_json&, const bool, const bool) for the
6679+
related UBJSON format
66796680
@sa @ref to_cbor(const basic_json&) for the related CBOR format
66806681
@sa @ref to_msgpack(const basic_json&) for the related MessagePack format
66816682
*/
@@ -6902,7 +6903,7 @@ class basic_json
69026903
related CBOR format
69036904
@sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for
69046905
the related UBJSON format
6905-
@sa @ref from_bson(detail::input_adapter, const bool, const bool) for
6906+
@sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for
69066907
the related BSON format
69076908
69086909
@since version 2.0.9; parameter @a start_index since 2.1.1; changed to
@@ -6989,7 +6990,7 @@ class basic_json
69896990
related CBOR format
69906991
@sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for
69916992
the related MessagePack format
6992-
@sa @ref from_bson(detail::input_adapter, const bool, const bool) for
6993+
@sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for
69936994
the related BSON format
69946995
69956996
@since version 3.1.0; added @a allow_exceptions parameter since 3.2.0
@@ -7068,13 +7069,12 @@ class basic_json
70687069
@throw parse_error.114 if an unsupported BSON record type is encountered
70697070
70707071
@sa http://bsonspec.org/spec.html
7071-
@sa @ref to_bson(const basic_json&, const bool, const bool) for the
7072-
analogous serialization
7073-
@sa @ref from_cbor(detail::input_adapter, const bool, const bool) for the
7072+
@sa @ref to_bson(const basic_json&) for the analogous serialization
7073+
@sa @ref from_cbor(detail::input_adapter&&, const bool, const bool) for the
70747074
related CBOR format
7075-
@sa @ref from_msgpack(detail::input_adapter, const bool, const bool) for
7075+
@sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for
70767076
the related MessagePack format
7077-
@sa @ref from_ubjson(detail::input_adapter, const bool, const bool) for the
7077+
@sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the
70787078
related UBJSON format
70797079
*/
70807080
static basic_json from_bson(detail::input_adapter&& i,

single_include/nlohmann/json.hpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ using json = basic_json<>;
204204

205205
/*!
206206
@brief macro to briefly define a mapping between an enum and JSON
207-
@macro NLOHMANN_JSON_SERIALIZE_ENUM
207+
@def NLOHMANN_JSON_SERIALIZE_ENUM
208208
@since version 3.4.0
209209
*/
210210
#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \
@@ -11635,7 +11635,7 @@ class json_pointer
1163511635

1163611636
@since version 2.0.0
1163711637
*/
11638-
std::string to_string() const noexcept
11638+
std::string to_string() const
1163911639
{
1164011640
return std::accumulate(reference_tokens.begin(), reference_tokens.end(),
1164111641
std::string{},
@@ -11690,7 +11690,7 @@ class json_pointer
1169011690
}
1169111691

1169211692
/// return whether pointer points to the root document
11693-
bool is_root() const
11693+
bool is_root() const noexcept
1169411694
{
1169511695
return reference_tokens.empty();
1169611696
}
@@ -12142,7 +12142,7 @@ class json_pointer
1214212142
{}
1214312143
}
1214412144

12145-
/// escape "~"" to "~0" and "/" to "~1"
12145+
/// escape "~" to "~0" and "/" to "~1"
1214612146
static std::string escape(std::string s)
1214712147
{
1214812148
replace_substring(s, "~", "~0");
@@ -12283,6 +12283,7 @@ class json_pointer
1228312283

1228412284
namespace nlohmann
1228512285
{
12286+
1228612287
template<typename, typename>
1228712288
struct adl_serializer
1228812289
{
@@ -12292,14 +12293,13 @@ struct adl_serializer
1229212293
This function is usually called by the `get()` function of the
1229312294
@ref basic_json class (either explicit or via conversion operators).
1229412295

12295-
@param[in] j JSON value to read from
12296+
@param[in] j JSON value to read from
1229612297
@param[in,out] val value to write to
1229712298
*/
1229812299
template<typename BasicJsonType, typename ValueType>
1229912300
static auto from_json(BasicJsonType&& j, ValueType& val) noexcept(
12300-
noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val))) -> decltype(
12301-
::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void()
12302-
)
12301+
noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)))
12302+
-> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
1230312303
{
1230412304
::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
1230512305
}
@@ -12311,17 +12311,17 @@ struct adl_serializer
1231112311
class.
1231212312

1231312313
@param[in,out] j JSON value to write to
12314-
@param[in] val value to read from
12314+
@param[in] val value to read from
1231512315
*/
1231612316
template <typename BasicJsonType, typename ValueType>
1231712317
static auto to_json(BasicJsonType& j, ValueType&& val) noexcept(
1231812318
noexcept(::nlohmann::to_json(j, std::forward<ValueType>(val))))
12319-
-> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)),
12320-
void())
12319+
-> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)), void())
1232112320
{
1232212321
::nlohmann::to_json(j, std::forward<ValueType>(val));
1232312322
}
1232412323
};
12324+
1232512325
} // namespace nlohmann
1232612326

1232712327

@@ -15660,7 +15660,7 @@ class basic_json
1566015660

1566115661
/*!
1566215662
@brief overload for a default value of type const char*
15663-
@copydoc basic_json::value(const typename object_t::key_type&, ValueType) const
15663+
@copydoc basic_json::value(const typename object_t::key_type&, const ValueType&) const
1566415664
*/
1566515665
string_t value(const typename object_t::key_type& key, const char* default_value) const
1566615666
{
@@ -18928,9 +18928,10 @@ class basic_json
1892818928
@complexity Linear in the size of the JSON value @a j.
1892918929

1893018930
@sa http://bsonspec.org/spec.html
18931-
@sa @ref from_bson(detail::input_adapter, const bool strict) for the
18931+
@sa @ref from_bson(detail::input_adapter&&, const bool strict) for the
1893218932
analogous deserialization
18933-
@sa @ref to_ubjson(const basic_json&) for the related UBJSON format
18933+
@sa @ref to_ubjson(const basic_json&, const bool, const bool) for the
18934+
related UBJSON format
1893418935
@sa @ref to_cbor(const basic_json&) for the related CBOR format
1893518936
@sa @ref to_msgpack(const basic_json&) for the related MessagePack format
1893618937
*/
@@ -19157,7 +19158,7 @@ class basic_json
1915719158
related CBOR format
1915819159
@sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for
1915919160
the related UBJSON format
19160-
@sa @ref from_bson(detail::input_adapter, const bool, const bool) for
19161+
@sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for
1916119162
the related BSON format
1916219163

1916319164
@since version 2.0.9; parameter @a start_index since 2.1.1; changed to
@@ -19244,7 +19245,7 @@ class basic_json
1924419245
related CBOR format
1924519246
@sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for
1924619247
the related MessagePack format
19247-
@sa @ref from_bson(detail::input_adapter, const bool, const bool) for
19248+
@sa @ref from_bson(detail::input_adapter&&, const bool, const bool) for
1924819249
the related BSON format
1924919250

1925019251
@since version 3.1.0; added @a allow_exceptions parameter since 3.2.0
@@ -19323,13 +19324,12 @@ class basic_json
1932319324
@throw parse_error.114 if an unsupported BSON record type is encountered
1932419325

1932519326
@sa http://bsonspec.org/spec.html
19326-
@sa @ref to_bson(const basic_json&, const bool, const bool) for the
19327-
analogous serialization
19328-
@sa @ref from_cbor(detail::input_adapter, const bool, const bool) for the
19327+
@sa @ref to_bson(const basic_json&) for the analogous serialization
19328+
@sa @ref from_cbor(detail::input_adapter&&, const bool, const bool) for the
1932919329
related CBOR format
19330-
@sa @ref from_msgpack(detail::input_adapter, const bool, const bool) for
19330+
@sa @ref from_msgpack(detail::input_adapter&&, const bool, const bool) for
1933119331
the related MessagePack format
19332-
@sa @ref from_ubjson(detail::input_adapter, const bool, const bool) for the
19332+
@sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the
1933319333
related UBJSON format
1933419334
*/
1933519335
static basic_json from_bson(detail::input_adapter&& i,

0 commit comments

Comments
 (0)