From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- ...-Templatize-basic_json-ctor-from-json_ref.patch | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 external/meta-openembedded/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json/0001-Templatize-basic_json-ctor-from-json_ref.patch (limited to 'external/meta-openembedded/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json/0001-Templatize-basic_json-ctor-from-json_ref.patch') diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json/0001-Templatize-basic_json-ctor-from-json_ref.patch b/external/meta-openembedded/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json/0001-Templatize-basic_json-ctor-from-json_ref.patch new file mode 100644 index 00000000..aea48b60 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json/0001-Templatize-basic_json-ctor-from-json_ref.patch @@ -0,0 +1,99 @@ +From ec955f08b47ab7cb81f6e4a4c3e7b331ddf50f71 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Art=C3=B6m=20Bakri=20Al-Sarmini?= <3sz3tt+git@gmail.com> +Date: Sun, 12 Apr 2020 22:32:39 +0300 +Subject: [PATCH] Templatize basic_json ctor from json_ref + +Upstream-Status: Backport [https://github.com/nlohmann/json/commit/ec955f08b47ab7cb81f6e4a4c3e7b331ddf50f71] +Signed-off-by: Andrew Geissler + +--- + include/nlohmann/detail/meta/type_traits.hpp | 13 ++++++++++++ + include/nlohmann/json.hpp | 8 ++++---- + single_include/nlohmann/json.hpp | 21 ++++++++++++++++---- + 3 files changed, 34 insertions(+), 8 deletions(-) + +diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp +index 280f6953..dd0b3084 100644 +--- a/include/nlohmann/detail/meta/type_traits.hpp ++++ b/include/nlohmann/detail/meta/type_traits.hpp +@@ -41,6 +41,19 @@ template struct is_basic_json : std::false_type {}; + NLOHMANN_BASIC_JSON_TPL_DECLARATION + struct is_basic_json : std::true_type {}; + ++////////////////////// ++// jspn_ref helpers // ++////////////////////// ++ ++template ++class json_ref; ++ ++template ++struct is_json_ref : std::false_type {}; ++ ++template ++struct is_json_ref> : std::true_type {}; ++ + ////////////////////////// + // aliases for detected // + ////////////////////////// +diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp +index 336d69fe..0598efc8 100644 +--- a/include/nlohmann/json.hpp ++++ b/include/nlohmann/json.hpp +@@ -1773,10 +1773,10 @@ class basic_json + // other constructors and destructor // + /////////////////////////////////////// + +- /// @private +- basic_json(const detail::json_ref& ref) +- : basic_json(ref.moved_or_copied()) +- {} ++ template , ++ std::is_same>::value, int> = 0 > ++ basic_json(const JsonRef& ref) : basic_json(ref.moved_or_copied()) {} + + /*! + @brief copy constructor +diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp +index 09464f3b..8927180e 100644 +--- a/single_include/nlohmann/json.hpp ++++ b/single_include/nlohmann/json.hpp +@@ -2794,6 +2794,19 @@ template struct is_basic_json : std::false_type {}; + NLOHMANN_BASIC_JSON_TPL_DECLARATION + struct is_basic_json : std::true_type {}; + ++////////////////////// ++// jspn_ref helpers // ++////////////////////// ++ ++template ++class json_ref; ++ ++template ++struct is_json_ref : std::false_type {}; ++ ++template ++struct is_json_ref> : std::true_type {}; ++ + ////////////////////////// + // aliases for detected // + ////////////////////////// +@@ -16632,10 +16645,10 @@ class basic_json + // other constructors and destructor // + /////////////////////////////////////// + +- /// @private +- basic_json(const detail::json_ref& ref) +- : basic_json(ref.moved_or_copied()) +- {} ++ template , ++ std::is_same>::value, int> = 0 > ++ basic_json(const JsonRef& ref) : basic_json(ref.moved_or_copied()) {} + + /*! + @brief copy constructor +-- +2.21.0 (Apple Git-122) + -- cgit 1.2.3-korg