1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

Merge branch 'develop' of github.com:gracicot/json into develop

This commit is contained in:
Guillaume Racicot
2018-06-04 11:18:25 -04:00
2 changed files with 20 additions and 0 deletions

View File

@ -51,6 +51,16 @@ struct external_constructor<value_t::string>
j.m_value = std::move(s); j.m_value = std::move(s);
j.assert_invariant(); j.assert_invariant();
} }
template<typename BasicJsonType, typename CompatibleStringType,
enable_if_t<not std::is_same<CompatibleStringType, typename BasicJsonType::string_t>::value,
int> = 0>
static void construct(BasicJsonType& j, const CompatibleStringType& str)
{
j.m_type = value_t::string;
j.m_value.string = j.template create<typename BasicJsonType::string_t>(str);
j.assert_invariant();
}
}; };
template<> template<>

View File

@ -1320,6 +1320,16 @@ struct external_constructor<value_t::string>
j.m_value = std::move(s); j.m_value = std::move(s);
j.assert_invariant(); j.assert_invariant();
} }
template<typename BasicJsonType, typename CompatibleStringType,
enable_if_t<not std::is_same<CompatibleStringType, typename BasicJsonType::string_t>::value,
int> = 0>
static void construct(BasicJsonType& j, const CompatibleStringType& str)
{
j.m_type = value_t::string;
j.m_value.string = j.template create<typename BasicJsonType::string_t>(str);
j.assert_invariant();
}
}; };
template<> template<>