* by default an empty class is used and the library behaves as it already did * if a user explicitly adds a base class (last template parameter) each node inherits it * this can be used to add custom extensions (e.g. add metadata / visitor methods) * add test for this feature
21 lines
315 B
C++
21 lines
315 B
C++
#pragma once
|
|
|
|
#include <type_traits>
|
|
|
|
namespace nlohmann
|
|
{
|
|
namespace detail
|
|
{
|
|
|
|
struct json_default_base {};
|
|
|
|
template<class T>
|
|
using json_base_class = typename std::conditional<
|
|
std::is_same<T, void>::value,
|
|
json_default_base,
|
|
T
|
|
>::type;
|
|
|
|
} // namespace detail
|
|
} // namespace nlohmann
|