anonymous namespace renamed to detail
This commit is contained in:
parent
2ee7399b6f
commit
0001032d42
18
src/json.hpp
18
src/json.hpp
@ -98,8 +98,8 @@ struct json_traits;
|
|||||||
@brief unnamed namespace with internal helper functions
|
@brief unnamed namespace with internal helper functions
|
||||||
@since version 1.0.0
|
@since version 1.0.0
|
||||||
*/
|
*/
|
||||||
// TODO transform this anon ns to detail?
|
|
||||||
namespace
|
namespace detail
|
||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
@brief Helper to determine whether there's a key_type for T.
|
@brief Helper to determine whether there's a key_type for T.
|
||||||
@ -143,8 +143,6 @@ struct has_json_traits
|
|||||||
static constexpr bool value = has_destructor<json_traits<T>>::value;
|
static constexpr bool value = has_destructor<json_traits<T>>::value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct has_json_traits<void> : std::false_type {};
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@brief helper class to create locales with decimal point
|
@brief helper class to create locales with decimal point
|
||||||
|
|
||||||
@ -1251,7 +1249,7 @@ class basic_json
|
|||||||
template <
|
template <
|
||||||
typename T,
|
typename T,
|
||||||
typename =
|
typename =
|
||||||
typename std::enable_if<has_json_traits<typename std::remove_cv<
|
typename std::enable_if<detail::has_json_traits<typename std::remove_cv<
|
||||||
typename std::remove_reference<T>::type>::type>::value>::type>
|
typename std::remove_reference<T>::type>::type>::value>::type>
|
||||||
explicit basic_json(T &&val)
|
explicit basic_json(T &&val)
|
||||||
: basic_json(json_traits<typename std::remove_cv<
|
: basic_json(json_traits<typename std::remove_cv<
|
||||||
@ -2232,7 +2230,7 @@ class basic_json
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
// fix locale problems
|
// fix locale problems
|
||||||
const static std::locale loc(std::locale(), new DecimalSeparator);
|
const static std::locale loc(std::locale(), new detail::DecimalSeparator);
|
||||||
ss.imbue(loc);
|
ss.imbue(loc);
|
||||||
|
|
||||||
// 6, 15 or 16 digits of precision allows round-trip IEEE 754
|
// 6, 15 or 16 digits of precision allows round-trip IEEE 754
|
||||||
@ -2618,7 +2616,7 @@ class basic_json
|
|||||||
template <
|
template <
|
||||||
typename T,
|
typename T,
|
||||||
typename =
|
typename =
|
||||||
typename std::enable_if<has_json_traits<typename std::remove_cv<
|
typename std::enable_if<detail::has_json_traits<typename std::remove_cv<
|
||||||
typename std::remove_reference<T>::type>::type>::value>::type>
|
typename std::remove_reference<T>::type>::type>::value>::type>
|
||||||
auto get_impl(T *) const -> decltype(
|
auto get_impl(T *) const -> decltype(
|
||||||
json_traits<typename std::remove_cv<typename std::remove_reference<
|
json_traits<typename std::remove_cv<typename std::remove_reference<
|
||||||
@ -2662,7 +2660,7 @@ class basic_json
|
|||||||
not std::is_same<basic_json_t, typename T::value_type>::value and
|
not std::is_same<basic_json_t, typename T::value_type>::value and
|
||||||
not std::is_arithmetic<T>::value and
|
not std::is_arithmetic<T>::value and
|
||||||
not std::is_convertible<std::string, T>::value and
|
not std::is_convertible<std::string, T>::value and
|
||||||
not has_mapped_type<T>::value, int>::type = 0>
|
not detail::has_mapped_type<T>::value, int>::type = 0>
|
||||||
T get_impl(T*) const
|
T get_impl(T*) const
|
||||||
{
|
{
|
||||||
if (is_array())
|
if (is_array())
|
||||||
@ -2707,7 +2705,7 @@ class basic_json
|
|||||||
/// get an array (explicit)
|
/// get an array (explicit)
|
||||||
template<class T, typename std::enable_if<
|
template<class T, typename std::enable_if<
|
||||||
std::is_same<basic_json, typename T::value_type>::value and
|
std::is_same<basic_json, typename T::value_type>::value and
|
||||||
not has_mapped_type<T>::value, int>::type = 0>
|
not detail::has_mapped_type<T>::value, int>::type = 0>
|
||||||
T get_impl(T*) const
|
T get_impl(T*) const
|
||||||
{
|
{
|
||||||
if (is_array())
|
if (is_array())
|
||||||
@ -5872,7 +5870,7 @@ class basic_json
|
|||||||
o.width(0);
|
o.width(0);
|
||||||
|
|
||||||
// fix locale problems
|
// fix locale problems
|
||||||
const auto old_locale = o.imbue(std::locale(std::locale(), new DecimalSeparator));
|
const auto old_locale = o.imbue(std::locale(std::locale(), new detail::DecimalSeparator));
|
||||||
// set precision
|
// set precision
|
||||||
|
|
||||||
// 6, 15 or 16 digits of precision allows round-trip IEEE 754
|
// 6, 15 or 16 digits of precision allows round-trip IEEE 754
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user