🔀 merge develop branch

parent 4703dd57
...@@ -1974,7 +1974,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -1974,7 +1974,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief access specified object element with bounds checking /// @brief access specified object element with bounds checking
/// @sa https://json.nlohmann.me/api/basic_json/at/ /// @sa https://json.nlohmann.me/api/basic_json/at/
template < class KeyT, typename detail::enable_if_t < template < class KeyT, typename detail::enable_if_t <
detail::is_usable_as_key_type<basic_json_t, KeyT>::value&& !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int > = 0 > detail::is_usable_as_key_type<basic_json_t, KeyT>::value&& !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int > = 0 >
reference at(const KeyT& key) reference at(const KeyT& key)
{ {
// at only works for objects // at only works for objects
...@@ -1994,7 +1994,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -1994,7 +1994,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief access specified object element with bounds checking /// @brief access specified object element with bounds checking
/// @sa https://json.nlohmann.me/api/basic_json/at/ /// @sa https://json.nlohmann.me/api/basic_json/at/
template < class KeyT, typename detail::enable_if_t < template < class KeyT, typename detail::enable_if_t <
detail::is_usable_as_key_type<basic_json_t, KeyT>::value&& !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int > = 0 > detail::is_usable_as_key_type<basic_json_t, KeyT>::value&& !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int > = 0 >
const_reference at(const KeyT& key) const const_reference at(const KeyT& key) const
{ {
// at only works for objects // at only works for objects
...@@ -2073,7 +2073,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -2073,7 +2073,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief access specified object element /// @brief access specified object element
/// @sa https://json.nlohmann.me/api/basic_json/operator%5B%5D/ /// @sa https://json.nlohmann.me/api/basic_json/operator%5B%5D/
template < class KeyT, typename detail::enable_if_t < template < class KeyT, typename detail::enable_if_t <
detail::is_usable_as_key_type<basic_json_t, KeyT>::value&& !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int > = 0 > detail::is_usable_as_key_type<basic_json_t, KeyT>::value&& !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int > = 0 >
reference operator[](KeyT && key) reference operator[](KeyT && key)
{ {
// implicitly convert null value to an empty object // implicitly convert null value to an empty object
...@@ -2097,7 +2097,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -2097,7 +2097,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief access specified object element /// @brief access specified object element
/// @sa https://json.nlohmann.me/api/basic_json/operator%5B%5D/ /// @sa https://json.nlohmann.me/api/basic_json/operator%5B%5D/
template < class KeyT, typename detail::enable_if_t < template < class KeyT, typename detail::enable_if_t <
detail::is_usable_as_key_type<basic_json_t, KeyT>::value&& !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int > = 0 > detail::is_usable_as_key_type<basic_json_t, KeyT>::value&& !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value, int > = 0 >
const_reference operator[](KeyT && key) const const_reference operator[](KeyT && key) const
{ {
// operator[] only works for objects // operator[] only works for objects
...@@ -2182,8 +2182,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -2182,8 +2182,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @sa https://json.nlohmann.me/api/basic_json/value/ /// @sa https://json.nlohmann.me/api/basic_json/value/
/// using std::is_convertible in a std::enable_if will fail when using explicit conversions /// using std::is_convertible in a std::enable_if will fail when using explicit conversions
template < class KeyType, class ValueType, typename detail::enable_if_t < template < class KeyType, class ValueType, typename detail::enable_if_t <
detail::is_getable<basic_json_t, ValueType>::value detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, ValueType>::value&& detail::is_usable_as_key_type<basic_json_t, KeyType>::value, int > = 0 > && !std::is_same<value_t, ValueType>::value&& detail::is_usable_as_key_type<basic_json_t, KeyType>::value, int > = 0 >
typename std::decay<ValueType>::type value(const KeyType& key, ValueType && default_value) const typename std::decay<ValueType>::type value(const KeyType& key, ValueType && default_value) const
{ {
// at only works for objects // at only works for objects
...@@ -2424,7 +2424,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -2424,7 +2424,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief remove element from a JSON object given a key /// @brief remove element from a JSON object given a key
/// @sa https://json.nlohmann.me/api/basic_json/erase/ /// @sa https://json.nlohmann.me/api/basic_json/erase/
template < class KeyT, typename detail::enable_if_t < template < class KeyT, typename detail::enable_if_t <
detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int> = 0> detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int> = 0>
size_type erase(const KeyT& key) size_type erase(const KeyT& key)
{ {
// this erase only works for objects // this erase only works for objects
...@@ -2492,7 +2492,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -2492,7 +2492,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief find an element in a JSON object /// @brief find an element in a JSON object
/// @sa https://json.nlohmann.me/api/basic_json/find/ /// @sa https://json.nlohmann.me/api/basic_json/find/
template < class KeyT, typename detail::enable_if_t < template < class KeyT, typename detail::enable_if_t <
detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int> = 0> detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int> = 0>
const_iterator find(const KeyT& key) const const_iterator find(const KeyT& key) const
{ {
auto result = cend(); auto result = cend();
...@@ -2518,7 +2518,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec ...@@ -2518,7 +2518,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief check the existence of an element in a JSON object /// @brief check the existence of an element in a JSON object
/// @sa https://json.nlohmann.me/api/basic_json/contains/ /// @sa https://json.nlohmann.me/api/basic_json/contains/
template < class KeyT, typename detail::enable_if_t < template < class KeyT, typename detail::enable_if_t <
!std::is_same<typename std::decay<KeyT>::type, json_pointer>::value&& detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int > = 0 > !std::is_same<typename std::decay<KeyT>::type, json_pointer>::value&& detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int > = 0 >
bool contains(const KeyT& key) const bool contains(const KeyT& key) const
{ {
return is_object() && m_value.object->find(key) != m_value.object->end(); return is_object() && m_value.object->find(key) != m_value.object->end();
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment