revert useless formatting
This commit is contained in:
parent
eb58a4e51c
commit
d2f8d439f9
36
src/json.hpp
36
src/json.hpp
@ -1336,14 +1336,15 @@ class basic_json
|
|||||||
|
|
||||||
@sa @ref basic_json(const typename string_t::value_type*) -- create a
|
@sa @ref basic_json(const typename string_t::value_type*) -- create a
|
||||||
string value from a character pointer
|
string value from a character pointer
|
||||||
@sa @ref basic_json(const CompatibleStringType&) -- create a string
|
@sa @ref basic_json(const CompatibleStringType&) -- create a string value
|
||||||
value
|
|
||||||
from a compatible string container
|
from a compatible string container
|
||||||
|
|
||||||
@since version 1.0.0
|
@since version 1.0.0
|
||||||
*/
|
*/
|
||||||
basic_json(const string_t &val) : m_type(value_t::string), m_value(val) {
|
basic_json(const string_t& val)
|
||||||
assert_invariant();
|
: m_type(value_t::string), m_value(val)
|
||||||
|
{
|
||||||
|
assert_invariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2709,20 +2710,19 @@ class basic_json
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// get an object (explicit)
|
template<class T, typename std::enable_if<
|
||||||
template <class T,
|
std::is_convertible<typename object_t::key_type, typename T::key_type>::value and
|
||||||
typename std::enable_if<
|
std::is_convertible<basic_json_t, typename T::mapped_type>::value, int>::type = 0>
|
||||||
std::is_convertible<typename object_t::key_type,
|
T get_impl(T*) const
|
||||||
typename T::key_type>::value and
|
{
|
||||||
std::is_convertible<basic_json_t,
|
if (is_object())
|
||||||
typename T::mapped_type>::value,
|
{
|
||||||
int>::type = 0>
|
return T(m_value.object->begin(), m_value.object->end());
|
||||||
T get_impl(T *) const {
|
}
|
||||||
if (is_object()) {
|
else
|
||||||
return T(m_value.object->begin(), m_value.object->end());
|
{
|
||||||
} else {
|
throw std::domain_error("type must be object, but is " + type_name());
|
||||||
throw std::domain_error("type must be object, but is " + type_name());
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// get an object (explicit)
|
/// get an object (explicit)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user