mirror of
https://github.com/nlohmann/json.git
synced 2026-10-05 22:20:30 +00:00
Add helper types to make it easier to create a basic_json type with modified template parameters
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -38,20 +38,7 @@ class json_metadata
|
||||
};
|
||||
|
||||
template<class T>
|
||||
using json_with_metadata =
|
||||
nlohmann::basic_json <
|
||||
std::map,
|
||||
std::vector,
|
||||
std::string,
|
||||
bool,
|
||||
std::int64_t,
|
||||
std::uint64_t,
|
||||
double,
|
||||
std::allocator,
|
||||
nlohmann::adl_serializer,
|
||||
std::vector<std::uint8_t>,
|
||||
json_metadata<T>
|
||||
>;
|
||||
using json_with_metadata = nlohmann::json::with_changed_base_class_t<json_metadata<T>>;
|
||||
|
||||
TEST_CASE("JSON Node Metadata")
|
||||
{
|
||||
@@ -268,19 +255,7 @@ class visitor_adaptor
|
||||
void do_visit(const Ptr& ptr, const Fnc& fnc) const;
|
||||
};
|
||||
|
||||
using json_with_visitor_t = nlohmann::basic_json <
|
||||
std::map,
|
||||
std::vector,
|
||||
std::string,
|
||||
bool,
|
||||
std::int64_t,
|
||||
std::uint64_t,
|
||||
double,
|
||||
std::allocator,
|
||||
nlohmann::adl_serializer,
|
||||
std::vector<std::uint8_t>,
|
||||
visitor_adaptor
|
||||
>;
|
||||
using json_with_visitor_t = nlohmann::json::with_changed_base_class_t<visitor_adaptor>;
|
||||
|
||||
template <class Fnc>
|
||||
void visitor_adaptor::visit(const Fnc& fnc) const
|
||||
|
||||
Reference in New Issue
Block a user