parent
ca407117ed
commit
d4f9594315
@ -115,7 +115,7 @@ class exception : public std::exception
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto str = std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
|
auto str = std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
|
||||||
[](const std::string& a, const std::string& b)
|
[](const std::string & a, const std::string & b)
|
||||||
{
|
{
|
||||||
return concat(a, '/', detail::escape(b));
|
return concat(a, '/', detail::escape(b));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -190,7 +190,7 @@ template<class...> struct conjunction : std::true_type { };
|
|||||||
template<class B> struct conjunction<B> : B { };
|
template<class B> struct conjunction<B> : B { };
|
||||||
template<class B, class... Bn>
|
template<class B, class... Bn>
|
||||||
struct conjunction<B, Bn...>
|
struct conjunction<B, Bn...>
|
||||||
: std::conditional<static_cast<bool>(B::value), conjunction<Bn...>, B>::type {};
|
: std::conditional<static_cast<bool>(B::value), conjunction<Bn...>, B>::type {};
|
||||||
|
|
||||||
// https://en.cppreference.com/w/cpp/types/negation
|
// https://en.cppreference.com/w/cpp/types/negation
|
||||||
template<class B> struct negation : std::integral_constant < bool, !B::value > { };
|
template<class B> struct negation : std::integral_constant < bool, !B::value > { };
|
||||||
@ -415,7 +415,7 @@ is_detected<range_value_t, ConstructibleArrayType>::value&&
|
|||||||
!std::is_same<ConstructibleArrayType, detected_t<range_value_t, ConstructibleArrayType>>::value&&
|
!std::is_same<ConstructibleArrayType, detected_t<range_value_t, ConstructibleArrayType>>::value&&
|
||||||
is_complete_type <
|
is_complete_type <
|
||||||
detected_t<range_value_t, ConstructibleArrayType >>::value >>
|
detected_t<range_value_t, ConstructibleArrayType >>::value >>
|
||||||
{
|
{
|
||||||
using value_type = range_value_t<ConstructibleArrayType>;
|
using value_type = range_value_t<ConstructibleArrayType>;
|
||||||
|
|
||||||
static constexpr bool value =
|
static constexpr bool value =
|
||||||
@ -426,7 +426,7 @@ is_detected<range_value_t, ConstructibleArrayType>::value&&
|
|||||||
has_non_default_from_json <
|
has_non_default_from_json <
|
||||||
BasicJsonType,
|
BasicJsonType,
|
||||||
value_type >::value;
|
value_type >::value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BasicJsonType, typename ConstructibleArrayType>
|
template<typename BasicJsonType, typename ConstructibleArrayType>
|
||||||
struct is_constructible_array_type
|
struct is_constructible_array_type
|
||||||
@ -509,7 +509,7 @@ template<typename Compare, typename A, typename B>
|
|||||||
struct is_comparable<Compare, A, B, void_t<
|
struct is_comparable<Compare, A, B, void_t<
|
||||||
decltype(std::declval<Compare>()(std::declval<A>(), std::declval<B>())),
|
decltype(std::declval<Compare>()(std::declval<A>(), std::declval<B>())),
|
||||||
decltype(std::declval<Compare>()(std::declval<B>(), std::declval<A>()))
|
decltype(std::declval<Compare>()(std::declval<B>(), std::declval<A>()))
|
||||||
>> : std::true_type {};
|
>> : std::true_type {};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using detect_is_transparent = typename T::is_transparent;
|
using detect_is_transparent = typename T::is_transparent;
|
||||||
|
|||||||
@ -4701,7 +4701,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
// the valid JSON Patch operations
|
// the valid JSON Patch operations
|
||||||
enum class patch_operations {add, remove, replace, move, copy, test, invalid};
|
enum class patch_operations {add, remove, replace, move, copy, test, invalid};
|
||||||
|
|
||||||
const auto get_op = [](const std::string& op)
|
const auto get_op = [](const std::string & op)
|
||||||
{
|
{
|
||||||
if (op == "add")
|
if (op == "add")
|
||||||
{
|
{
|
||||||
@ -4838,8 +4838,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
for (const auto& val : json_patch)
|
for (const auto& val : json_patch)
|
||||||
{
|
{
|
||||||
// wrapper to get a value for an operation
|
// wrapper to get a value for an operation
|
||||||
const auto get_value = [&val](const std::string& op,
|
const auto get_value = [&val](const std::string & op,
|
||||||
const std::string& member,
|
const std::string & member,
|
||||||
bool string_type) -> basic_json &
|
bool string_type) -> basic_json &
|
||||||
{
|
{
|
||||||
// find value
|
// find value
|
||||||
@ -5216,14 +5216,14 @@ struct less< ::nlohmann::detail::value_t> // do not remove the space after '<',
|
|||||||
*/
|
*/
|
||||||
bool operator()(::nlohmann::detail::value_t lhs,
|
bool operator()(::nlohmann::detail::value_t lhs,
|
||||||
::nlohmann::detail::value_t rhs) const noexcept
|
::nlohmann::detail::value_t rhs) const noexcept
|
||||||
{
|
{
|
||||||
#if JSON_HAS_THREE_WAY_COMPARISON
|
#if JSON_HAS_THREE_WAY_COMPARISON
|
||||||
return std::is_lt(lhs <=> rhs); // *NOPAD*
|
return std::is_lt(lhs <=> rhs); // *NOPAD*
|
||||||
#else
|
#else
|
||||||
return ::nlohmann::detail::operator<(lhs, rhs);
|
return ::nlohmann::detail::operator<(lhs, rhs);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// C++20 prohibit function specialization in the std namespace.
|
// C++20 prohibit function specialization in the std namespace.
|
||||||
#ifndef JSON_HAS_CPP_20
|
#ifndef JSON_HAS_CPP_20
|
||||||
|
|||||||
@ -27,7 +27,7 @@ NLOHMANN_JSON_NAMESPACE_BEGIN
|
|||||||
template <class Key, class T, class IgnoredLess = std::less<Key>,
|
template <class Key, class T, class IgnoredLess = std::less<Key>,
|
||||||
class Allocator = std::allocator<std::pair<const Key, T>>>
|
class Allocator = std::allocator<std::pair<const Key, T>>>
|
||||||
struct ordered_map : std::vector<std::pair<const Key, T>, Allocator>
|
struct ordered_map : std::vector<std::pair<const Key, T>, Allocator>
|
||||||
{
|
{
|
||||||
using key_type = Key;
|
using key_type = Key;
|
||||||
using mapped_type = T;
|
using mapped_type = T;
|
||||||
using Container = std::vector<std::pair<const Key, T>, Allocator>;
|
using Container = std::vector<std::pair<const Key, T>, Allocator>;
|
||||||
@ -43,16 +43,16 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
|
|||||||
|
|
||||||
// Explicit constructors instead of `using Container::Container`
|
// Explicit constructors instead of `using Container::Container`
|
||||||
// otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4)
|
// otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4)
|
||||||
ordered_map() noexcept(noexcept(Container())) : Container{} {}
|
ordered_map() noexcept(noexcept(Container())) : Container{} {}
|
||||||
explicit ordered_map(const Allocator& alloc) noexcept(noexcept(Container(alloc))) : Container{alloc} {}
|
explicit ordered_map(const Allocator& alloc) noexcept(noexcept(Container(alloc))) : Container{alloc} {}
|
||||||
template <class It>
|
template <class It>
|
||||||
ordered_map(It first, It last, const Allocator& alloc = Allocator())
|
ordered_map(It first, It last, const Allocator& alloc = Allocator())
|
||||||
: Container{first, last, alloc} {}
|
: Container{first, last, alloc} {}
|
||||||
ordered_map(std::initializer_list<value_type> init, const Allocator& alloc = Allocator() )
|
ordered_map(std::initializer_list<value_type> init, const Allocator& alloc = Allocator() )
|
||||||
: Container{init, alloc} {}
|
: Container{init, alloc} {}
|
||||||
|
|
||||||
std::pair<iterator, bool> emplace(const key_type& key, T&& t)
|
std::pair<iterator, bool> emplace(const key_type& key, T&& t)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -62,12 +62,12 @@ std::pair<iterator, bool> emplace(const key_type& key, T&& t)
|
|||||||
}
|
}
|
||||||
Container::emplace_back(key, std::forward<T>(t));
|
Container::emplace_back(key, std::forward<T>(t));
|
||||||
return {std::prev(this->end()), true};
|
return {std::prev(this->end()), true};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
std::pair<iterator, bool> emplace(KeyType && key, T && t)
|
std::pair<iterator, bool> emplace(KeyType && key, T && t)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -77,34 +77,34 @@ std::pair<iterator, bool> emplace(KeyType && key, T && t)
|
|||||||
}
|
}
|
||||||
Container::emplace_back(std::forward<KeyType>(key), std::forward<T>(t));
|
Container::emplace_back(std::forward<KeyType>(key), std::forward<T>(t));
|
||||||
return {std::prev(this->end()), true};
|
return {std::prev(this->end()), true};
|
||||||
}
|
}
|
||||||
|
|
||||||
T& operator[](const key_type& key)
|
T& operator[](const key_type& key)
|
||||||
{
|
{
|
||||||
return emplace(key, T{}).first->second;
|
return emplace(key, T{}).first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
T & operator[](KeyType && key)
|
T & operator[](KeyType && key)
|
||||||
{
|
{
|
||||||
return emplace(std::forward<KeyType>(key), T{}).first->second;
|
return emplace(std::forward<KeyType>(key), T{}).first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
const T& operator[](const key_type& key) const
|
const T& operator[](const key_type& key) const
|
||||||
{
|
{
|
||||||
return at(key);
|
return at(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
const T & operator[](KeyType && key) const
|
const T & operator[](KeyType && key) const
|
||||||
{
|
{
|
||||||
return at(std::forward<KeyType>(key));
|
return at(std::forward<KeyType>(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
T& at(const key_type& key)
|
T& at(const key_type& key)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -114,12 +114,12 @@ T& at(const key_type& key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(std::out_of_range("key not found"));
|
JSON_THROW(std::out_of_range("key not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
T & at(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
T & at(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -129,10 +129,10 @@ T & at(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(std::out_of_range("key not found"));
|
JSON_THROW(std::out_of_range("key not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
const T& at(const key_type& key) const
|
const T& at(const key_type& key) const
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -142,12 +142,12 @@ const T& at(const key_type& key) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(std::out_of_range("key not found"));
|
JSON_THROW(std::out_of_range("key not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
const T & at(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forward)
|
const T & at(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -157,10 +157,10 @@ const T & at(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forwa
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(std::out_of_range("key not found"));
|
JSON_THROW(std::out_of_range("key not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type erase(const key_type& key)
|
size_type erase(const key_type& key)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -176,12 +176,12 @@ size_type erase(const key_type& key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
size_type erase(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
size_type erase(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -197,15 +197,15 @@ size_type erase(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator erase(iterator pos)
|
iterator erase(iterator pos)
|
||||||
{
|
{
|
||||||
return erase(pos, std::next(pos));
|
return erase(pos, std::next(pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator erase(iterator first, iterator last)
|
iterator erase(iterator first, iterator last)
|
||||||
{
|
{
|
||||||
if (first == last)
|
if (first == last)
|
||||||
{
|
{
|
||||||
return first;
|
return first;
|
||||||
@ -255,10 +255,10 @@ iterator erase(iterator first, iterator last)
|
|||||||
// use this iterator, because it may have been invalidated by the
|
// use this iterator, because it may have been invalidated by the
|
||||||
// resize call. Instead, we can return begin() + offset.
|
// resize call. Instead, we can return begin() + offset.
|
||||||
return Container::begin() + offset;
|
return Container::begin() + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type count(const key_type& key) const
|
size_type count(const key_type& key) const
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -267,12 +267,12 @@ size_type count(const key_type& key) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
size_type count(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forward)
|
size_type count(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -281,10 +281,10 @@ size_type count(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-fo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator find(const key_type& key)
|
iterator find(const key_type& key)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -293,12 +293,12 @@ iterator find(const key_type& key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Container::end();
|
return Container::end();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
iterator find(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
iterator find(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -307,10 +307,10 @@ iterator find(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Container::end();
|
return Container::end();
|
||||||
}
|
}
|
||||||
|
|
||||||
const_iterator find(const key_type& key) const
|
const_iterator find(const key_type& key) const
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -319,15 +319,15 @@ const_iterator find(const key_type& key) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Container::end();
|
return Container::end();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<iterator, bool> insert( value_type&& value )
|
std::pair<iterator, bool> insert( value_type&& value )
|
||||||
{
|
{
|
||||||
return emplace(value.first, std::move(value.second));
|
return emplace(value.first, std::move(value.second));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<iterator, bool> insert( const value_type& value )
|
std::pair<iterator, bool> insert( const value_type& value )
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, value.first))
|
if (m_compare(it->first, value.first))
|
||||||
@ -337,23 +337,23 @@ std::pair<iterator, bool> insert( const value_type& value )
|
|||||||
}
|
}
|
||||||
Container::push_back(value);
|
Container::push_back(value);
|
||||||
return {--this->end(), true};
|
return {--this->end(), true};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename InputIt>
|
template<typename InputIt>
|
||||||
using require_input_iter = typename std::enable_if<std::is_convertible<typename std::iterator_traits<InputIt>::iterator_category,
|
using require_input_iter = typename std::enable_if<std::is_convertible<typename std::iterator_traits<InputIt>::iterator_category,
|
||||||
std::input_iterator_tag>::value>::type;
|
std::input_iterator_tag>::value>::type;
|
||||||
|
|
||||||
template<typename InputIt, typename = require_input_iter<InputIt>>
|
template<typename InputIt, typename = require_input_iter<InputIt>>
|
||||||
void insert(InputIt first, InputIt last)
|
void insert(InputIt first, InputIt last)
|
||||||
{
|
{
|
||||||
for (auto it = first; it != last; ++it)
|
for (auto it = first; it != last; ++it)
|
||||||
{
|
{
|
||||||
insert(*it);
|
insert(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
JSON_NO_UNIQUE_ADDRESS key_compare m_compare = key_compare();
|
JSON_NO_UNIQUE_ADDRESS key_compare m_compare = key_compare();
|
||||||
};
|
};
|
||||||
|
|
||||||
NLOHMANN_JSON_NAMESPACE_END
|
NLOHMANN_JSON_NAMESPACE_END
|
||||||
|
|||||||
@ -41,7 +41,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
// #include <nlohmann/detail/abi_macros.hpp>
|
// #include <nlohmann/detail/abi_macros.hpp>
|
||||||
@ -54,7 +53,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// This file contains all macro definitions affecting or depending on the ABI
|
// This file contains all macro definitions affecting or depending on the ABI
|
||||||
|
|
||||||
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
||||||
@ -156,7 +154,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm> // transform
|
#include <algorithm> // transform
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <forward_list> // forward_list
|
#include <forward_list> // forward_list
|
||||||
@ -179,7 +176,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstddef> // nullptr_t
|
#include <cstddef> // nullptr_t
|
||||||
#include <exception> // exception
|
#include <exception> // exception
|
||||||
#if JSON_DIAGNOSTICS
|
#if JSON_DIAGNOSTICS
|
||||||
@ -199,7 +195,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <cstdint> // uint8_t
|
#include <cstdint> // uint8_t
|
||||||
@ -215,7 +210,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <utility> // declval, pair
|
#include <utility> // declval, pair
|
||||||
// #include <nlohmann/detail/meta/detected.hpp>
|
// #include <nlohmann/detail/meta/detected.hpp>
|
||||||
// __ _____ _____ _____
|
// __ _____ _____ _____
|
||||||
@ -227,7 +221,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
// #include <nlohmann/detail/meta/void_t.hpp>
|
// #include <nlohmann/detail/meta/void_t.hpp>
|
||||||
@ -240,7 +233,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #include <nlohmann/detail/abi_macros.hpp>
|
// #include <nlohmann/detail/abi_macros.hpp>
|
||||||
|
|
||||||
|
|
||||||
@ -2940,7 +2932,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #include <nlohmann/detail/abi_macros.hpp>
|
// #include <nlohmann/detail/abi_macros.hpp>
|
||||||
|
|
||||||
|
|
||||||
@ -3015,7 +3006,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
|
|
||||||
// #include <nlohmann/detail/abi_macros.hpp>
|
// #include <nlohmann/detail/abi_macros.hpp>
|
||||||
@ -3058,7 +3048,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <type_traits> // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type
|
#include <type_traits> // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type
|
||||||
@ -3231,7 +3220,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <limits> // numeric_limits
|
#include <limits> // numeric_limits
|
||||||
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
|
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
|
||||||
#include <utility> // declval
|
#include <utility> // declval
|
||||||
@ -3247,7 +3235,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <iterator> // random_access_iterator_tag
|
#include <iterator> // random_access_iterator_tag
|
||||||
|
|
||||||
// #include <nlohmann/detail/abi_macros.hpp>
|
// #include <nlohmann/detail/abi_macros.hpp>
|
||||||
@ -3315,7 +3302,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #include <nlohmann/detail/macro_scope.hpp>
|
// #include <nlohmann/detail/macro_scope.hpp>
|
||||||
|
|
||||||
|
|
||||||
@ -3335,7 +3321,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #include <nlohmann/detail/macro_scope.hpp>
|
// #include <nlohmann/detail/macro_scope.hpp>
|
||||||
|
|
||||||
|
|
||||||
@ -3597,7 +3582,7 @@ template<class...> struct conjunction : std::true_type { };
|
|||||||
template<class B> struct conjunction<B> : B { };
|
template<class B> struct conjunction<B> : B { };
|
||||||
template<class B, class... Bn>
|
template<class B, class... Bn>
|
||||||
struct conjunction<B, Bn...>
|
struct conjunction<B, Bn...>
|
||||||
: std::conditional<static_cast<bool>(B::value), conjunction<Bn...>, B>::type {};
|
: std::conditional<static_cast<bool>(B::value), conjunction<Bn...>, B>::type {};
|
||||||
|
|
||||||
// https://en.cppreference.com/w/cpp/types/negation
|
// https://en.cppreference.com/w/cpp/types/negation
|
||||||
template<class B> struct negation : std::integral_constant < bool, !B::value > { };
|
template<class B> struct negation : std::integral_constant < bool, !B::value > { };
|
||||||
@ -3822,7 +3807,7 @@ is_detected<range_value_t, ConstructibleArrayType>::value&&
|
|||||||
!std::is_same<ConstructibleArrayType, detected_t<range_value_t, ConstructibleArrayType>>::value&&
|
!std::is_same<ConstructibleArrayType, detected_t<range_value_t, ConstructibleArrayType>>::value&&
|
||||||
is_complete_type <
|
is_complete_type <
|
||||||
detected_t<range_value_t, ConstructibleArrayType >>::value >>
|
detected_t<range_value_t, ConstructibleArrayType >>::value >>
|
||||||
{
|
{
|
||||||
using value_type = range_value_t<ConstructibleArrayType>;
|
using value_type = range_value_t<ConstructibleArrayType>;
|
||||||
|
|
||||||
static constexpr bool value =
|
static constexpr bool value =
|
||||||
@ -3833,7 +3818,7 @@ is_detected<range_value_t, ConstructibleArrayType>::value&&
|
|||||||
has_non_default_from_json <
|
has_non_default_from_json <
|
||||||
BasicJsonType,
|
BasicJsonType,
|
||||||
value_type >::value;
|
value_type >::value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename BasicJsonType, typename ConstructibleArrayType>
|
template<typename BasicJsonType, typename ConstructibleArrayType>
|
||||||
struct is_constructible_array_type
|
struct is_constructible_array_type
|
||||||
@ -3916,7 +3901,7 @@ template<typename Compare, typename A, typename B>
|
|||||||
struct is_comparable<Compare, A, B, void_t<
|
struct is_comparable<Compare, A, B, void_t<
|
||||||
decltype(std::declval<Compare>()(std::declval<A>(), std::declval<B>())),
|
decltype(std::declval<Compare>()(std::declval<A>(), std::declval<B>())),
|
||||||
decltype(std::declval<Compare>()(std::declval<B>(), std::declval<A>()))
|
decltype(std::declval<Compare>()(std::declval<B>(), std::declval<A>()))
|
||||||
>> : std::true_type {};
|
>> : std::true_type {};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using detect_is_transparent = typename T::is_transparent;
|
using detect_is_transparent = typename T::is_transparent;
|
||||||
@ -4158,7 +4143,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstring> // strlen
|
#include <cstring> // strlen
|
||||||
#include <string> // string
|
#include <string> // string
|
||||||
#include <utility> // forward
|
#include <utility> // forward
|
||||||
@ -4389,7 +4373,7 @@ class exception : public std::exception
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto str = std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
|
auto str = std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
|
||||||
[](const std::string& a, const std::string& b)
|
[](const std::string & a, const std::string & b)
|
||||||
{
|
{
|
||||||
return concat(a, '/', detail::escape(b));
|
return concat(a, '/', detail::escape(b));
|
||||||
});
|
});
|
||||||
@ -4544,7 +4528,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #include <nlohmann/detail/abi_macros.hpp>
|
// #include <nlohmann/detail/abi_macros.hpp>
|
||||||
|
|
||||||
|
|
||||||
@ -4568,7 +4551,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #include <nlohmann/detail/macro_scope.hpp>
|
// #include <nlohmann/detail/macro_scope.hpp>
|
||||||
|
|
||||||
|
|
||||||
@ -5074,7 +5056,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm> // copy
|
#include <algorithm> // copy
|
||||||
#include <iterator> // begin, end
|
#include <iterator> // begin, end
|
||||||
#include <string> // string
|
#include <string> // string
|
||||||
@ -5094,7 +5075,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <iterator> // input_iterator_tag
|
#include <iterator> // input_iterator_tag
|
||||||
#include <string> // string, to_string
|
#include <string> // string, to_string
|
||||||
@ -5815,7 +5795,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstdint> // uint8_t, uint64_t
|
#include <cstdint> // uint8_t, uint64_t
|
||||||
#include <tuple> // tie
|
#include <tuple> // tie
|
||||||
#include <utility> // move
|
#include <utility> // move
|
||||||
@ -5927,7 +5906,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstdint> // uint8_t
|
#include <cstdint> // uint8_t
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <functional> // hash
|
#include <functional> // hash
|
||||||
@ -6060,7 +6038,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm> // generate_n
|
#include <algorithm> // generate_n
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <cmath> // ldexp
|
#include <cmath> // ldexp
|
||||||
@ -6086,7 +6063,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <cstring> // strlen
|
#include <cstring> // strlen
|
||||||
@ -6581,7 +6557,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <string> // string
|
#include <string> // string
|
||||||
#include <utility> // move
|
#include <utility> // move
|
||||||
@ -7313,7 +7288,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <clocale> // localeconv
|
#include <clocale> // localeconv
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
@ -8952,7 +8926,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstdint> // size_t
|
#include <cstdint> // size_t
|
||||||
#include <utility> // declval
|
#include <utility> // declval
|
||||||
#include <string> // string
|
#include <string> // string
|
||||||
@ -12104,7 +12077,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cmath> // isfinite
|
#include <cmath> // isfinite
|
||||||
#include <cstdint> // uint8_t
|
#include <cstdint> // uint8_t
|
||||||
#include <functional> // function
|
#include <functional> // function
|
||||||
@ -12621,7 +12593,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #include <nlohmann/detail/abi_macros.hpp>
|
// #include <nlohmann/detail/abi_macros.hpp>
|
||||||
|
|
||||||
// #include <nlohmann/detail/iterators/primitive_iterator.hpp>
|
// #include <nlohmann/detail/iterators/primitive_iterator.hpp>
|
||||||
@ -12634,7 +12605,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstddef> // ptrdiff_t
|
#include <cstddef> // ptrdiff_t
|
||||||
#include <limits> // numeric_limits
|
#include <limits> // numeric_limits
|
||||||
|
|
||||||
@ -12793,7 +12763,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <iterator> // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next
|
#include <iterator> // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next
|
||||||
#include <type_traits> // conditional, is_const, remove_const
|
#include <type_traits> // conditional, is_const, remove_const
|
||||||
|
|
||||||
@ -13555,7 +13524,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstddef> // ptrdiff_t
|
#include <cstddef> // ptrdiff_t
|
||||||
#include <iterator> // reverse_iterator
|
#include <iterator> // reverse_iterator
|
||||||
#include <utility> // declval
|
#include <utility> // declval
|
||||||
@ -13724,7 +13692,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm> // all_of
|
#include <algorithm> // all_of
|
||||||
#include <cctype> // isdigit
|
#include <cctype> // isdigit
|
||||||
#include <cerrno> // errno, ERANGE
|
#include <cerrno> // errno, ERANGE
|
||||||
@ -14719,7 +14686,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@ -14811,7 +14777,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm> // reverse
|
#include <algorithm> // reverse
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <map> // map
|
#include <map> // map
|
||||||
@ -14837,7 +14802,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm> // copy
|
#include <algorithm> // copy
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <iterator> // back_inserter
|
#include <iterator> // back_inserter
|
||||||
@ -16806,7 +16770,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm> // reverse, remove, fill, find, none_of
|
#include <algorithm> // reverse, remove, fill, find, none_of
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <clocale> // localeconv, lconv
|
#include <clocale> // localeconv, lconv
|
||||||
@ -16831,7 +16794,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <array> // array
|
#include <array> // array
|
||||||
#include <cmath> // signbit, isfinite
|
#include <cmath> // signbit, isfinite
|
||||||
#include <cstdint> // intN_t, uintN_t
|
#include <cstdint> // intN_t, uintN_t
|
||||||
@ -18926,7 +18888,6 @@ NLOHMANN_JSON_NAMESPACE_END
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <functional> // equal_to, less
|
#include <functional> // equal_to, less
|
||||||
#include <initializer_list> // initializer_list
|
#include <initializer_list> // initializer_list
|
||||||
#include <iterator> // input_iterator_tag, iterator_traits
|
#include <iterator> // input_iterator_tag, iterator_traits
|
||||||
@ -18948,7 +18909,7 @@ NLOHMANN_JSON_NAMESPACE_BEGIN
|
|||||||
template <class Key, class T, class IgnoredLess = std::less<Key>,
|
template <class Key, class T, class IgnoredLess = std::less<Key>,
|
||||||
class Allocator = std::allocator<std::pair<const Key, T>>>
|
class Allocator = std::allocator<std::pair<const Key, T>>>
|
||||||
struct ordered_map : std::vector<std::pair<const Key, T>, Allocator>
|
struct ordered_map : std::vector<std::pair<const Key, T>, Allocator>
|
||||||
{
|
{
|
||||||
using key_type = Key;
|
using key_type = Key;
|
||||||
using mapped_type = T;
|
using mapped_type = T;
|
||||||
using Container = std::vector<std::pair<const Key, T>, Allocator>;
|
using Container = std::vector<std::pair<const Key, T>, Allocator>;
|
||||||
@ -18964,16 +18925,16 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
|
|||||||
|
|
||||||
// Explicit constructors instead of `using Container::Container`
|
// Explicit constructors instead of `using Container::Container`
|
||||||
// otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4)
|
// otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4)
|
||||||
ordered_map() noexcept(noexcept(Container())) : Container{} {}
|
ordered_map() noexcept(noexcept(Container())) : Container{} {}
|
||||||
explicit ordered_map(const Allocator& alloc) noexcept(noexcept(Container(alloc))) : Container{alloc} {}
|
explicit ordered_map(const Allocator& alloc) noexcept(noexcept(Container(alloc))) : Container{alloc} {}
|
||||||
template <class It>
|
template <class It>
|
||||||
ordered_map(It first, It last, const Allocator& alloc = Allocator())
|
ordered_map(It first, It last, const Allocator& alloc = Allocator())
|
||||||
: Container{first, last, alloc} {}
|
: Container{first, last, alloc} {}
|
||||||
ordered_map(std::initializer_list<value_type> init, const Allocator& alloc = Allocator() )
|
ordered_map(std::initializer_list<value_type> init, const Allocator& alloc = Allocator() )
|
||||||
: Container{init, alloc} {}
|
: Container{init, alloc} {}
|
||||||
|
|
||||||
std::pair<iterator, bool> emplace(const key_type& key, T&& t)
|
std::pair<iterator, bool> emplace(const key_type& key, T&& t)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -18983,12 +18944,12 @@ std::pair<iterator, bool> emplace(const key_type& key, T&& t)
|
|||||||
}
|
}
|
||||||
Container::emplace_back(key, std::forward<T>(t));
|
Container::emplace_back(key, std::forward<T>(t));
|
||||||
return {std::prev(this->end()), true};
|
return {std::prev(this->end()), true};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
std::pair<iterator, bool> emplace(KeyType && key, T && t)
|
std::pair<iterator, bool> emplace(KeyType && key, T && t)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -18998,34 +18959,34 @@ std::pair<iterator, bool> emplace(KeyType && key, T && t)
|
|||||||
}
|
}
|
||||||
Container::emplace_back(std::forward<KeyType>(key), std::forward<T>(t));
|
Container::emplace_back(std::forward<KeyType>(key), std::forward<T>(t));
|
||||||
return {std::prev(this->end()), true};
|
return {std::prev(this->end()), true};
|
||||||
}
|
}
|
||||||
|
|
||||||
T& operator[](const key_type& key)
|
T& operator[](const key_type& key)
|
||||||
{
|
{
|
||||||
return emplace(key, T{}).first->second;
|
return emplace(key, T{}).first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
T & operator[](KeyType && key)
|
T & operator[](KeyType && key)
|
||||||
{
|
{
|
||||||
return emplace(std::forward<KeyType>(key), T{}).first->second;
|
return emplace(std::forward<KeyType>(key), T{}).first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
const T& operator[](const key_type& key) const
|
const T& operator[](const key_type& key) const
|
||||||
{
|
{
|
||||||
return at(key);
|
return at(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
const T & operator[](KeyType && key) const
|
const T & operator[](KeyType && key) const
|
||||||
{
|
{
|
||||||
return at(std::forward<KeyType>(key));
|
return at(std::forward<KeyType>(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
T& at(const key_type& key)
|
T& at(const key_type& key)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19035,12 +18996,12 @@ T& at(const key_type& key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(std::out_of_range("key not found"));
|
JSON_THROW(std::out_of_range("key not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
T & at(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
T & at(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19050,10 +19011,10 @@ T & at(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(std::out_of_range("key not found"));
|
JSON_THROW(std::out_of_range("key not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
const T& at(const key_type& key) const
|
const T& at(const key_type& key) const
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19063,12 +19024,12 @@ const T& at(const key_type& key) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(std::out_of_range("key not found"));
|
JSON_THROW(std::out_of_range("key not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
const T & at(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forward)
|
const T & at(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19078,10 +19039,10 @@ const T & at(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forwa
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(std::out_of_range("key not found"));
|
JSON_THROW(std::out_of_range("key not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type erase(const key_type& key)
|
size_type erase(const key_type& key)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19097,12 +19058,12 @@ size_type erase(const key_type& key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
size_type erase(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
size_type erase(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19118,15 +19079,15 @@ size_type erase(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator erase(iterator pos)
|
iterator erase(iterator pos)
|
||||||
{
|
{
|
||||||
return erase(pos, std::next(pos));
|
return erase(pos, std::next(pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator erase(iterator first, iterator last)
|
iterator erase(iterator first, iterator last)
|
||||||
{
|
{
|
||||||
if (first == last)
|
if (first == last)
|
||||||
{
|
{
|
||||||
return first;
|
return first;
|
||||||
@ -19176,10 +19137,10 @@ iterator erase(iterator first, iterator last)
|
|||||||
// use this iterator, because it may have been invalidated by the
|
// use this iterator, because it may have been invalidated by the
|
||||||
// resize call. Instead, we can return begin() + offset.
|
// resize call. Instead, we can return begin() + offset.
|
||||||
return Container::begin() + offset;
|
return Container::begin() + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type count(const key_type& key) const
|
size_type count(const key_type& key) const
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19188,12 +19149,12 @@ size_type count(const key_type& key) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
size_type count(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forward)
|
size_type count(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19202,10 +19163,10 @@ size_type count(KeyType && key) const // NOLINT(cppcoreguidelines-missing-std-fo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator find(const key_type& key)
|
iterator find(const key_type& key)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19214,12 +19175,12 @@ iterator find(const key_type& key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Container::end();
|
return Container::end();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class KeyType, detail::enable_if_t<
|
template<class KeyType, detail::enable_if_t<
|
||||||
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>
|
||||||
iterator find(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
iterator find(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19228,10 +19189,10 @@ iterator find(KeyType && key) // NOLINT(cppcoreguidelines-missing-std-forward)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Container::end();
|
return Container::end();
|
||||||
}
|
}
|
||||||
|
|
||||||
const_iterator find(const key_type& key) const
|
const_iterator find(const key_type& key) const
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, key))
|
if (m_compare(it->first, key))
|
||||||
@ -19240,15 +19201,15 @@ const_iterator find(const key_type& key) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Container::end();
|
return Container::end();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<iterator, bool> insert( value_type&& value )
|
std::pair<iterator, bool> insert( value_type&& value )
|
||||||
{
|
{
|
||||||
return emplace(value.first, std::move(value.second));
|
return emplace(value.first, std::move(value.second));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<iterator, bool> insert( const value_type& value )
|
std::pair<iterator, bool> insert( const value_type& value )
|
||||||
{
|
{
|
||||||
for (auto it = this->begin(); it != this->end(); ++it)
|
for (auto it = this->begin(); it != this->end(); ++it)
|
||||||
{
|
{
|
||||||
if (m_compare(it->first, value.first))
|
if (m_compare(it->first, value.first))
|
||||||
@ -19258,24 +19219,24 @@ std::pair<iterator, bool> insert( const value_type& value )
|
|||||||
}
|
}
|
||||||
Container::push_back(value);
|
Container::push_back(value);
|
||||||
return {--this->end(), true};
|
return {--this->end(), true};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename InputIt>
|
template<typename InputIt>
|
||||||
using require_input_iter = typename std::enable_if<std::is_convertible<typename std::iterator_traits<InputIt>::iterator_category,
|
using require_input_iter = typename std::enable_if<std::is_convertible<typename std::iterator_traits<InputIt>::iterator_category,
|
||||||
std::input_iterator_tag>::value>::type;
|
std::input_iterator_tag>::value>::type;
|
||||||
|
|
||||||
template<typename InputIt, typename = require_input_iter<InputIt>>
|
template<typename InputIt, typename = require_input_iter<InputIt>>
|
||||||
void insert(InputIt first, InputIt last)
|
void insert(InputIt first, InputIt last)
|
||||||
{
|
{
|
||||||
for (auto it = first; it != last; ++it)
|
for (auto it = first; it != last; ++it)
|
||||||
{
|
{
|
||||||
insert(*it);
|
insert(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
JSON_NO_UNIQUE_ADDRESS key_compare m_compare = key_compare();
|
JSON_NO_UNIQUE_ADDRESS key_compare m_compare = key_compare();
|
||||||
};
|
};
|
||||||
|
|
||||||
NLOHMANN_JSON_NAMESPACE_END
|
NLOHMANN_JSON_NAMESPACE_END
|
||||||
|
|
||||||
@ -23920,7 +23881,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
// the valid JSON Patch operations
|
// the valid JSON Patch operations
|
||||||
enum class patch_operations {add, remove, replace, move, copy, test, invalid};
|
enum class patch_operations {add, remove, replace, move, copy, test, invalid};
|
||||||
|
|
||||||
const auto get_op = [](const std::string& op)
|
const auto get_op = [](const std::string & op)
|
||||||
{
|
{
|
||||||
if (op == "add")
|
if (op == "add")
|
||||||
{
|
{
|
||||||
@ -24057,8 +24018,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
|||||||
for (const auto& val : json_patch)
|
for (const auto& val : json_patch)
|
||||||
{
|
{
|
||||||
// wrapper to get a value for an operation
|
// wrapper to get a value for an operation
|
||||||
const auto get_value = [&val](const std::string& op,
|
const auto get_value = [&val](const std::string & op,
|
||||||
const std::string& member,
|
const std::string & member,
|
||||||
bool string_type) -> basic_json &
|
bool string_type) -> basic_json &
|
||||||
{
|
{
|
||||||
// find value
|
// find value
|
||||||
@ -24435,14 +24396,14 @@ struct less< ::nlohmann::detail::value_t> // do not remove the space after '<',
|
|||||||
*/
|
*/
|
||||||
bool operator()(::nlohmann::detail::value_t lhs,
|
bool operator()(::nlohmann::detail::value_t lhs,
|
||||||
::nlohmann::detail::value_t rhs) const noexcept
|
::nlohmann::detail::value_t rhs) const noexcept
|
||||||
{
|
{
|
||||||
#if JSON_HAS_THREE_WAY_COMPARISON
|
#if JSON_HAS_THREE_WAY_COMPARISON
|
||||||
return std::is_lt(lhs <=> rhs); // *NOPAD*
|
return std::is_lt(lhs <=> rhs); // *NOPAD*
|
||||||
#else
|
#else
|
||||||
return ::nlohmann::detail::operator<(lhs, rhs);
|
return ::nlohmann::detail::operator<(lhs, rhs);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// C++20 prohibit function specialization in the std namespace.
|
// C++20 prohibit function specialization in the std namespace.
|
||||||
#ifndef JSON_HAS_CPP_20
|
#ifndef JSON_HAS_CPP_20
|
||||||
@ -24481,7 +24442,6 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// restore clang diagnostic settings
|
// restore clang diagnostic settings
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
@ -24526,7 +24486,6 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#undef JSON_HEDLEY_ALWAYS_INLINE
|
#undef JSON_HEDLEY_ALWAYS_INLINE
|
||||||
#undef JSON_HEDLEY_ARM_VERSION
|
#undef JSON_HEDLEY_ARM_VERSION
|
||||||
#undef JSON_HEDLEY_ARM_VERSION_CHECK
|
#undef JSON_HEDLEY_ARM_VERSION_CHECK
|
||||||
@ -24677,5 +24636,4 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
|
|||||||
#undef JSON_HEDLEY_FALL_THROUGH
|
#undef JSON_HEDLEY_FALL_THROUGH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // INCLUDE_NLOHMANN_JSON_HPP_
|
#endif // INCLUDE_NLOHMANN_JSON_HPP_
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// This file contains all macro definitions affecting or depending on the ABI
|
// This file contains all macro definitions affecting or depending on the ABI
|
||||||
|
|
||||||
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
|
||||||
|
|||||||
@ -106,7 +106,7 @@ TEST_CASE("compliance tests from nativejson-benchmark")
|
|||||||
|
|
||||||
SECTION("doubles")
|
SECTION("doubles")
|
||||||
{
|
{
|
||||||
auto TEST_DOUBLE = [](const std::string& json_string, const double expected)
|
auto TEST_DOUBLE = [](const std::string & json_string, const double expected)
|
||||||
{
|
{
|
||||||
CAPTURE(json_string)
|
CAPTURE(json_string)
|
||||||
CAPTURE(expected)
|
CAPTURE(expected)
|
||||||
@ -238,7 +238,7 @@ TEST_CASE("compliance tests from nativejson-benchmark")
|
|||||||
|
|
||||||
SECTION("strings")
|
SECTION("strings")
|
||||||
{
|
{
|
||||||
auto TEST_STRING = [](const std::string& json_string, const std::string& expected)
|
auto TEST_STRING = [](const std::string & json_string, const std::string & expected)
|
||||||
{
|
{
|
||||||
CAPTURE(json_string)
|
CAPTURE(json_string)
|
||||||
CAPTURE(expected)
|
CAPTURE(expected)
|
||||||
|
|||||||
@ -126,7 +126,7 @@ TEST_CASE("digit gen")
|
|||||||
{
|
{
|
||||||
SECTION("single precision")
|
SECTION("single precision")
|
||||||
{
|
{
|
||||||
auto check_float = [](float number, const std::string& digits, int expected_exponent)
|
auto check_float = [](float number, const std::string & digits, int expected_exponent)
|
||||||
{
|
{
|
||||||
CAPTURE(number)
|
CAPTURE(number)
|
||||||
CAPTURE(digits)
|
CAPTURE(digits)
|
||||||
@ -190,7 +190,7 @@ TEST_CASE("digit gen")
|
|||||||
|
|
||||||
SECTION("double precision")
|
SECTION("double precision")
|
||||||
{
|
{
|
||||||
auto check_double = [](double number, const std::string& digits, int expected_exponent)
|
auto check_double = [](double number, const std::string & digits, int expected_exponent)
|
||||||
{
|
{
|
||||||
CAPTURE(number)
|
CAPTURE(number)
|
||||||
CAPTURE(digits)
|
CAPTURE(digits)
|
||||||
@ -336,7 +336,7 @@ TEST_CASE("formatting")
|
|||||||
{
|
{
|
||||||
SECTION("single precision")
|
SECTION("single precision")
|
||||||
{
|
{
|
||||||
auto check_float = [](float number, const std::string& expected)
|
auto check_float = [](float number, const std::string & expected)
|
||||||
{
|
{
|
||||||
std::array<char, 33> buf{};
|
std::array<char, 33> buf{};
|
||||||
char* end = nlohmann::detail::to_chars(buf.data(), buf.data() + 32, number); // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
|
char* end = nlohmann::detail::to_chars(buf.data(), buf.data() + 32, number); // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
|
||||||
@ -396,7 +396,7 @@ TEST_CASE("formatting")
|
|||||||
|
|
||||||
SECTION("double precision")
|
SECTION("double precision")
|
||||||
{
|
{
|
||||||
auto check_double = [](double number, const std::string& expected)
|
auto check_double = [](double number, const std::string & expected)
|
||||||
{
|
{
|
||||||
std::array<char, 33> buf{};
|
std::array<char, 33> buf{};
|
||||||
char* end = nlohmann::detail::to_chars(buf.data(), buf.data() + 32, number); // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
|
char* end = nlohmann::detail::to_chars(buf.data(), buf.data() + 32, number); // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
|
||||||
@ -456,7 +456,7 @@ TEST_CASE("formatting")
|
|||||||
|
|
||||||
SECTION("integer")
|
SECTION("integer")
|
||||||
{
|
{
|
||||||
auto check_integer = [](std::int64_t number, const std::string& expected)
|
auto check_integer = [](std::int64_t number, const std::string & expected)
|
||||||
{
|
{
|
||||||
const nlohmann::json j = number;
|
const nlohmann::json j = number;
|
||||||
CHECK(j.dump() == expected);
|
CHECK(j.dump() == expected);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user