mirror of
https://github.com/nlohmann/json.git
synced 2026-02-23 11:56:24 +00:00
Reimplement value() access functions (#3663)
* Reimplement value() access functions * Merges the 'const char *' with the 'ValueType &&' overloads. * Fixes ambiguities when default value is 0. * Fixes 'no matching function' error when specifying ValueType template parameter. * Fixes incorrect template parameter order in previous overloads. * Add additional value() tests * Make JSON_MultipleHeaders visible to unit tests Define the macro JSON_TEST_USING_MULTIPLE_HEADERS to 0/1 depending on JSON_MultipleHeaders. * Add type_traits unit test * Update documentation
This commit is contained in:
committed by
GitHub
parent
8eee62d388
commit
0c7a18374c
@@ -7,7 +7,7 @@ ValueType value(const typename object_t::key_type& key,
|
||||
ValueType&& default_value) const;
|
||||
|
||||
// (2)
|
||||
template<class KeyType, class ValueType>
|
||||
template<class ValueType, class KeyType>
|
||||
ValueType value(KeyType&& key,
|
||||
ValueType&& default_value) const;
|
||||
|
||||
@@ -155,5 +155,5 @@ changes to any JSON value.
|
||||
## Version history
|
||||
|
||||
1. Added in version 1.0.0. Changed parameter `default_value` type from `const ValueType&` to `ValueType&&` in version 3.11.0.
|
||||
2. Added in version 3.11.0.
|
||||
2. Added in version 3.11.0. Made `ValueType` the first template parameter in version 3.11.2.
|
||||
3. Added in version 2.0.2.
|
||||
|
||||
Reference in New Issue
Block a user