💚 add fix from dd4eef3460
This commit is contained in:
parent
76109db662
commit
e86d8b9477
@ -3555,7 +3555,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
can be thrown.,at__object_t_key_type}
|
||||
*/
|
||||
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 > ... >
|
||||
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)
|
||||
{
|
||||
// at only works for objects
|
||||
@ -3604,7 +3604,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
at__object_t_key_type_const}
|
||||
*/
|
||||
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 > ... >
|
||||
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
|
||||
{
|
||||
// at only works for objects
|
||||
@ -3749,7 +3749,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
@since version 1.0.0; template KeyT added in version 3.10.0
|
||||
*/
|
||||
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 > ... >
|
||||
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)
|
||||
{
|
||||
// implicitly convert null value to an empty object
|
||||
@ -3802,7 +3802,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
@since version 1.0.0; template KeyT added in version 3.10.0
|
||||
*/
|
||||
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 > ... >
|
||||
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
|
||||
{
|
||||
// operator[] only works for objects
|
||||
@ -3871,7 +3871,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
// 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 <
|
||||
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 > ... >
|
||||
&& !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
|
||||
{
|
||||
// at only works for objects
|
||||
@ -3895,7 +3895,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
@copydoc basic_json::value(const typename object_t::key_type&, const ValueType&) const
|
||||
*/
|
||||
template < class KeyType, typename detail::enable_if_t <
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyType>::value > ... >
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyType>::value, int> = 0>
|
||||
string_t value(const KeyType& key, const char* default_value) const
|
||||
{
|
||||
return value(key, string_t(default_value));
|
||||
@ -4325,7 +4325,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
@since version 1.0.0; template added in version 3.10.0
|
||||
*/
|
||||
template < class KeyT, typename detail::enable_if_t <
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyT>::value > ... >
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int> = 0>
|
||||
size_type erase(const KeyT& key)
|
||||
{
|
||||
// this erase only works for objects
|
||||
@ -4421,7 +4421,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
@since version 1.0.0
|
||||
*/
|
||||
template < class KeyT, typename detail::enable_if_t <
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyT>::value > ... >
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int> = 0>
|
||||
iterator find(const KeyT& key)
|
||||
{
|
||||
auto result = end();
|
||||
@ -4439,7 +4439,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
@copydoc find(const KeyT&)
|
||||
*/
|
||||
template < class KeyT, typename detail::enable_if_t <
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyT>::value > ... >
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int> = 0>
|
||||
const_iterator find(const KeyT& key) const
|
||||
{
|
||||
auto result = cend();
|
||||
@ -4474,7 +4474,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
@since version 1.0.0
|
||||
*/
|
||||
template < class KeyT, typename detail::enable_if_t <
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyT>::value > ... >
|
||||
detail::is_usable_as_key_type<basic_json_t, KeyT>::value, int> = 0>
|
||||
size_type count(const KeyT& key) const
|
||||
{
|
||||
// return 0 for all nonobject types
|
||||
@ -4507,7 +4507,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
@since version 3.6.0
|
||||
*/
|
||||
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 > ... >
|
||||
!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
|
||||
{
|
||||
return is_object() && m_value.object->find(key) != m_value.object->end();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user