From a946dfc19c3bbef2106d43b62e614e5e5671f9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20DELRIEU?= Date: Wed, 17 Oct 2018 12:03:10 +0200 Subject: [PATCH] add a note to maintainers in type_traits.hpp --- include/nlohmann/detail/meta/type_traits.hpp | 9 +++++++++ single_include/nlohmann/json.hpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index 7f71313c0..efe878f62 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -26,6 +26,15 @@ namespace detail // helpers // ///////////// +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + template struct is_basic_json : std::false_type {}; NLOHMANN_BASIC_JSON_TPL_DECLARATION diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index ffd16603a..47c9f1c75 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -386,6 +386,15 @@ namespace detail // helpers // ///////////// +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + template struct is_basic_json : std::false_type {}; NLOHMANN_BASIC_JSON_TPL_DECLARATION