FreeBSD Bugzilla – Attachment 196495 Details for
Bug 230629
net/zerotier: fails to build with libc++ 7
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
minimal fix
patch-ext_json_json.hpp (text/plain), 2.47 KB, created by
Jan Beich
on 2018-08-24 09:18:20 UTC
(
hide
)
Description:
minimal fix
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2018-08-24 09:18:20 UTC
Size:
2.47 KB
patch
obsolete
>https://github.com/nlohmann/json/commit/8165707990e4 > >--- ext/json/json.hpp.orig 2018-05-11 20:40:22 UTC >+++ ext/json/json.hpp >@@ -353,6 +353,16 @@ struct is_compatible_object_type_impl<true, RealType, > std::is_constructible<typename RealType::mapped_type, typename CompatibleObjectType::mapped_type>::value; > }; > >+template<bool B, class RealType, class CompatibleStringType> >+struct is_compatible_string_type_impl : std::false_type {}; >+ >+template<class RealType, class CompatibleStringType> >+struct is_compatible_string_type_impl<true, RealType, CompatibleStringType> >+{ >+ static constexpr auto value = >+ std::is_same<typename RealType::value_type, typename CompatibleStringType::value_type>::value; >+}; >+ > template<class BasicJsonType, class CompatibleObjectType> > struct is_compatible_object_type > { >@@ -363,6 +373,15 @@ struct is_compatible_object_type > typename BasicJsonType::object_t, CompatibleObjectType >::value; > }; > >+template<class BasicJsonType, class CompatibleStringType> >+struct is_compatible_string_type >+{ >+ static auto constexpr value = is_compatible_string_type_impl < >+ conjunction<negation<std::is_same<void, CompatibleStringType>>, >+ has_value_type<CompatibleStringType>>::value, >+ typename BasicJsonType::string_t, CompatibleStringType >::value; >+}; >+ > template<typename BasicJsonType, typename T> > struct is_basic_json_nested_type > { >@@ -974,6 +993,25 @@ void from_json(const BasicJsonType& j, typename BasicJ > { > JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); > } >+ s = *j.template get_ptr<const typename BasicJsonType::string_t*>(); >+} >+ >+template < >+ typename BasicJsonType, typename CompatibleStringType, >+ enable_if_t < >+ is_compatible_string_type<BasicJsonType, CompatibleStringType>::value and >+ not std::is_same<typename BasicJsonType::string_t, >+ CompatibleStringType>::value and >+ std::is_constructible < >+ BasicJsonType, typename CompatibleStringType::value_type >::value, >+ int > = 0 > >+void from_json(const BasicJsonType& j, CompatibleStringType& s) >+{ >+ if (JSON_UNLIKELY(not j.is_string())) >+ { >+ JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()))); >+ } >+ > s = *j.template get_ptr<const typename BasicJsonType::string_t*>(); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 230629
:
196495