mirror of
https://github.com/nlohmann/json.git
synced 2025-07-24 02:21:01 +03:00
🚧 trying nodiscard attribute #1433
This commit is contained in:
@ -317,6 +317,7 @@ class basic_json
|
||||
|
||||
@since 2.1.0
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json meta()
|
||||
{
|
||||
basic_json result;
|
||||
@ -1489,6 +1490,7 @@ class basic_json
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json array(initializer_list_t init = {})
|
||||
{
|
||||
return basic_json(init, false, value_t::array);
|
||||
@ -1532,6 +1534,7 @@ class basic_json
|
||||
|
||||
@since version 1.0.0
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json object(initializer_list_t init = {})
|
||||
{
|
||||
return basic_json(init, false, value_t::object);
|
||||
@ -6051,6 +6054,7 @@ class basic_json
|
||||
|
||||
@since version 2.0.3 (contiguous containers)
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json parse(detail::input_adapter&& i,
|
||||
const parser_callback_t cb = nullptr,
|
||||
const bool allow_exceptions = true)
|
||||
@ -6826,6 +6830,7 @@ class basic_json
|
||||
@a strict parameter since 3.0.0; added @a allow_exceptions parameter
|
||||
since 3.2.0
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json from_cbor(detail::input_adapter&& i,
|
||||
const bool strict = true,
|
||||
const bool allow_exceptions = true)
|
||||
@ -6841,6 +6846,7 @@ class basic_json
|
||||
*/
|
||||
template<typename A1, typename A2,
|
||||
detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0>
|
||||
JSON_NODISCARD
|
||||
static basic_json from_cbor(A1 && a1, A2 && a2,
|
||||
const bool strict = true,
|
||||
const bool allow_exceptions = true)
|
||||
@ -6933,6 +6939,7 @@ class basic_json
|
||||
@a strict parameter since 3.0.0; added @a allow_exceptions parameter
|
||||
since 3.2.0
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json from_msgpack(detail::input_adapter&& i,
|
||||
const bool strict = true,
|
||||
const bool allow_exceptions = true)
|
||||
@ -6948,6 +6955,7 @@ class basic_json
|
||||
*/
|
||||
template<typename A1, typename A2,
|
||||
detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0>
|
||||
JSON_NODISCARD
|
||||
static basic_json from_msgpack(A1 && a1, A2 && a2,
|
||||
const bool strict = true,
|
||||
const bool allow_exceptions = true)
|
||||
@ -7019,6 +7027,7 @@ class basic_json
|
||||
|
||||
@since version 3.1.0; added @a allow_exceptions parameter since 3.2.0
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json from_ubjson(detail::input_adapter&& i,
|
||||
const bool strict = true,
|
||||
const bool allow_exceptions = true)
|
||||
@ -7034,6 +7043,7 @@ class basic_json
|
||||
*/
|
||||
template<typename A1, typename A2,
|
||||
detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0>
|
||||
JSON_NODISCARD
|
||||
static basic_json from_ubjson(A1 && a1, A2 && a2,
|
||||
const bool strict = true,
|
||||
const bool allow_exceptions = true)
|
||||
@ -7104,6 +7114,7 @@ class basic_json
|
||||
@sa @ref from_ubjson(detail::input_adapter&&, const bool, const bool) for the
|
||||
related UBJSON format
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json from_bson(detail::input_adapter&& i,
|
||||
const bool strict = true,
|
||||
const bool allow_exceptions = true)
|
||||
@ -7119,6 +7130,7 @@ class basic_json
|
||||
*/
|
||||
template<typename A1, typename A2,
|
||||
detail::enable_if_t<std::is_constructible<detail::input_adapter, A1, A2>::value, int> = 0>
|
||||
JSON_NODISCARD
|
||||
static basic_json from_bson(A1 && a1, A2 && a2,
|
||||
const bool strict = true,
|
||||
const bool allow_exceptions = true)
|
||||
@ -7710,6 +7722,7 @@ class basic_json
|
||||
|
||||
@since version 2.0.0
|
||||
*/
|
||||
JSON_NODISCARD
|
||||
static basic_json diff(const basic_json& source, const basic_json& target,
|
||||
const std::string& path = "")
|
||||
{
|
||||
|
Reference in New Issue
Block a user