diff --git a/include/nlohmann/detail/macro_scope.hpp b/include/nlohmann/detail/macro_scope.hpp index ee5519b76..f3309e6b9 100644 --- a/include/nlohmann/detail/macro_scope.hpp +++ b/include/nlohmann/detail/macro_scope.hpp @@ -133,12 +133,13 @@ template class AllocatorType, \ template class JSONSerializer, \ class BinaryType, \ - template class LexerType> + template class LexerType, \ + template class SerializerType> #define NLOHMANN_BASIC_JSON_TPL \ basic_json + AllocatorType, JSONSerializer, BinaryType, LexerType, SerializerType> // Macros to simplify conversion from/to types diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 318da5e28..25b3b2c1b 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -231,7 +231,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec template using binary_writer = ::nlohmann::detail::binary_writer; JSON_PRIVATE_UNLESS_TESTED: - using serializer = ::nlohmann::detail::serializer; + // using serializer = ::nlohmann::detail::serializer; + using serializer = SerializerType; public: using value_t = detail::value_t; diff --git a/include/nlohmann/json_fwd.hpp b/include/nlohmann/json_fwd.hpp index dead19b0d..66c685f8c 100644 --- a/include/nlohmann/json_fwd.hpp +++ b/include/nlohmann/json_fwd.hpp @@ -28,6 +28,9 @@ namespace detail { template class lexer; + +template +class serializer; } template class ObjectType = @@ -41,7 +44,8 @@ template class ObjectType = template class JSONSerializer = adl_serializer, class BinaryType = std::vector, - template class LexerType = detail::lexer> + template class LexerType = detail::lexer, + template class SerializerType = detail::serializer> class basic_json; /*!