update nlohmann::json to 3.10.4

This commit is contained in:
2021-12-11 23:32:21 +01:00
parent 4a1dde26ce
commit 42ff7c8099
39 changed files with 5323 additions and 2710 deletions

View File

@ -1,10 +1,16 @@
#pragma once
#include <functional> // less
#include <initializer_list> // initializer_list
#include <iterator> // input_iterator_tag, iterator_traits
#include <memory> // allocator
#include <stdexcept> // for out_of_range
#include <type_traits> // enable_if, is_convertible
#include <utility> // pair
#include <vector> // vector
#include <nlohmann/detail/macro_scope.hpp>
namespace nlohmann
{
@ -64,7 +70,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
}
}
throw std::out_of_range("key not found");
JSON_THROW(std::out_of_range("key not found"));
}
const T& at(const Key& key) const
@ -77,7 +83,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
}
}
throw std::out_of_range("key not found");
JSON_THROW(std::out_of_range("key not found"));
}
size_type erase(const Key& key)
@ -166,6 +172,19 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
Container::push_back(value);
return {--this->end(), true};
}
template<typename InputIt>
using require_input_iter = typename std::enable_if<std::is_convertible<typename std::iterator_traits<InputIt>::iterator_category,
std::input_iterator_tag>::value>::type;
template<typename InputIt, typename = require_input_iter<InputIt>>
void insert(InputIt first, InputIt last)
{
for (auto it = first; it != last; ++it)
{
insert(*it);
}
}
};
} // namespace nlohmann