mirror of
https://github.com/nlohmann/json.git
synced 2025-06-13 13:18:50 +08:00
Enable member function calls in trailing return decltype expressions for older compilers.
This commit is contained in:
parent
fc8c584288
commit
fbf6df63d9
@ -2908,7 +2908,6 @@ class basic_json
|
|||||||
- @ref json_serializer<ValueType> does not have a `from_json()` method of
|
- @ref json_serializer<ValueType> does not have a `from_json()` method of
|
||||||
the form `ValueType from_json(const basic_json&)`
|
the form `ValueType from_json(const basic_json&)`
|
||||||
|
|
||||||
@tparam ValueTypeCV the provided value type
|
|
||||||
@tparam ValueType the returned value type
|
@tparam ValueType the returned value type
|
||||||
|
|
||||||
@return copy of the JSON value, converted to @a ValueType
|
@return copy of the JSON value, converted to @a ValueType
|
||||||
@ -2924,9 +2923,9 @@ class basic_json
|
|||||||
|
|
||||||
@since version 2.1.0
|
@since version 2.1.0
|
||||||
*/
|
*/
|
||||||
template < typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>,
|
template < typename ValueType,
|
||||||
detail::enable_if_t <
|
detail::enable_if_t <
|
||||||
detail::is_default_constructible<ValueType>::value &&
|
detail::is_default_constructible<ValueType>::value&&
|
||||||
detail::has_from_json<basic_json_t, ValueType>::value,
|
detail::has_from_json<basic_json_t, ValueType>::value,
|
||||||
int > = 0 >
|
int > = 0 >
|
||||||
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
|
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
|
||||||
@ -2948,7 +2947,7 @@ class basic_json
|
|||||||
|
|
||||||
The function is equivalent to executing
|
The function is equivalent to executing
|
||||||
@code {.cpp}
|
@code {.cpp}
|
||||||
return JSONSerializer<ValueTypeCV>::from_json(*this);
|
return JSONSerializer<ValueType>::from_json(*this);
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
This overloads is chosen if:
|
This overloads is chosen if:
|
||||||
@ -2959,7 +2958,6 @@ class basic_json
|
|||||||
@note If @ref json_serializer<ValueType> has both overloads of
|
@note If @ref json_serializer<ValueType> has both overloads of
|
||||||
`from_json()`, this one is chosen.
|
`from_json()`, this one is chosen.
|
||||||
|
|
||||||
@tparam ValueTypeCV the provided value type
|
|
||||||
@tparam ValueType the returned value type
|
@tparam ValueType the returned value type
|
||||||
|
|
||||||
@return copy of the JSON value, converted to @a ValueType
|
@return copy of the JSON value, converted to @a ValueType
|
||||||
@ -2968,7 +2966,7 @@ class basic_json
|
|||||||
|
|
||||||
@since version 2.1.0
|
@since version 2.1.0
|
||||||
*/
|
*/
|
||||||
template < typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>,
|
template < typename ValueType,
|
||||||
detail::enable_if_t <
|
detail::enable_if_t <
|
||||||
detail::has_non_default_from_json<basic_json_t, ValueType>::value,
|
detail::has_non_default_from_json<basic_json_t, ValueType>::value,
|
||||||
int > = 0 >
|
int > = 0 >
|
||||||
@ -2993,7 +2991,8 @@ class basic_json
|
|||||||
|
|
||||||
@since version 3.2.0
|
@since version 3.2.0
|
||||||
*/
|
*/
|
||||||
template < typename BasicJsonType, detail::enable_if_t <
|
template < typename BasicJsonType,
|
||||||
|
detail::enable_if_t <
|
||||||
detail::is_basic_json<BasicJsonType>::value,
|
detail::is_basic_json<BasicJsonType>::value,
|
||||||
int > = 0 >
|
int > = 0 >
|
||||||
BasicJsonType get_impl(detail::priority_tag<2> /*unused*/) const
|
BasicJsonType get_impl(detail::priority_tag<2> /*unused*/) const
|
||||||
@ -3015,7 +3014,8 @@ class basic_json
|
|||||||
|
|
||||||
@since version 2.1.0
|
@since version 2.1.0
|
||||||
*/
|
*/
|
||||||
template<typename BasicJsonType, detail::enable_if_t<
|
template<typename BasicJsonType,
|
||||||
|
detail::enable_if_t<
|
||||||
std::is_same<BasicJsonType, basic_json_t>::value,
|
std::is_same<BasicJsonType, basic_json_t>::value,
|
||||||
int> = 0>
|
int> = 0>
|
||||||
basic_json get_impl(detail::priority_tag<3> /*unused*/) const
|
basic_json get_impl(detail::priority_tag<3> /*unused*/) const
|
||||||
@ -3027,8 +3027,10 @@ class basic_json
|
|||||||
@brief get a pointer value (explicit)
|
@brief get a pointer value (explicit)
|
||||||
@copydoc get()
|
@copydoc get()
|
||||||
*/
|
*/
|
||||||
template<typename PointerType, detail::enable_if_t<
|
template<typename PointerType,
|
||||||
std::is_pointer<PointerType>::value, int> = 0>
|
detail::enable_if_t<
|
||||||
|
std::is_pointer<PointerType>::value,
|
||||||
|
int> = 0>
|
||||||
constexpr auto get_impl(detail::priority_tag<4> /*unused*/) const noexcept
|
constexpr auto get_impl(detail::priority_tag<4> /*unused*/) const noexcept
|
||||||
-> decltype(std::declval<const basic_json_t&>().template get_ptr<PointerType>())
|
-> decltype(std::declval<const basic_json_t&>().template get_ptr<PointerType>())
|
||||||
{
|
{
|
||||||
@ -3061,8 +3063,9 @@ class basic_json
|
|||||||
@since version 2.1.0
|
@since version 2.1.0
|
||||||
*/
|
*/
|
||||||
template < typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>>
|
template < typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>>
|
||||||
constexpr auto get() const noexcept(noexcept(get_impl<ValueType>(detail::priority_tag<4> {})))
|
constexpr auto get() const noexcept(
|
||||||
-> decltype(get_impl<ValueType>(detail::priority_tag<4> {}))
|
noexcept(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {})))
|
||||||
|
-> decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {}))
|
||||||
{
|
{
|
||||||
// we cannot static_assert on ValueTypeCV being non-const, because
|
// we cannot static_assert on ValueTypeCV being non-const, because
|
||||||
// there is support for get<const basic_json_t>(), which is why we
|
// there is support for get<const basic_json_t>(), which is why we
|
||||||
|
@ -19667,7 +19667,6 @@ class basic_json
|
|||||||
- @ref json_serializer<ValueType> does not have a `from_json()` method of
|
- @ref json_serializer<ValueType> does not have a `from_json()` method of
|
||||||
the form `ValueType from_json(const basic_json&)`
|
the form `ValueType from_json(const basic_json&)`
|
||||||
|
|
||||||
@tparam ValueTypeCV the provided value type
|
|
||||||
@tparam ValueType the returned value type
|
@tparam ValueType the returned value type
|
||||||
|
|
||||||
@return copy of the JSON value, converted to @a ValueType
|
@return copy of the JSON value, converted to @a ValueType
|
||||||
@ -19683,9 +19682,9 @@ class basic_json
|
|||||||
|
|
||||||
@since version 2.1.0
|
@since version 2.1.0
|
||||||
*/
|
*/
|
||||||
template < typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>,
|
template < typename ValueType,
|
||||||
detail::enable_if_t <
|
detail::enable_if_t <
|
||||||
detail::is_default_constructible<ValueType>::value &&
|
detail::is_default_constructible<ValueType>::value&&
|
||||||
detail::has_from_json<basic_json_t, ValueType>::value,
|
detail::has_from_json<basic_json_t, ValueType>::value,
|
||||||
int > = 0 >
|
int > = 0 >
|
||||||
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
|
ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept(
|
||||||
@ -19707,7 +19706,7 @@ class basic_json
|
|||||||
|
|
||||||
The function is equivalent to executing
|
The function is equivalent to executing
|
||||||
@code {.cpp}
|
@code {.cpp}
|
||||||
return JSONSerializer<ValueTypeCV>::from_json(*this);
|
return JSONSerializer<ValueType>::from_json(*this);
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
This overloads is chosen if:
|
This overloads is chosen if:
|
||||||
@ -19718,7 +19717,6 @@ class basic_json
|
|||||||
@note If @ref json_serializer<ValueType> has both overloads of
|
@note If @ref json_serializer<ValueType> has both overloads of
|
||||||
`from_json()`, this one is chosen.
|
`from_json()`, this one is chosen.
|
||||||
|
|
||||||
@tparam ValueTypeCV the provided value type
|
|
||||||
@tparam ValueType the returned value type
|
@tparam ValueType the returned value type
|
||||||
|
|
||||||
@return copy of the JSON value, converted to @a ValueType
|
@return copy of the JSON value, converted to @a ValueType
|
||||||
@ -19727,7 +19725,7 @@ class basic_json
|
|||||||
|
|
||||||
@since version 2.1.0
|
@since version 2.1.0
|
||||||
*/
|
*/
|
||||||
template < typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>,
|
template < typename ValueType,
|
||||||
detail::enable_if_t <
|
detail::enable_if_t <
|
||||||
detail::has_non_default_from_json<basic_json_t, ValueType>::value,
|
detail::has_non_default_from_json<basic_json_t, ValueType>::value,
|
||||||
int > = 0 >
|
int > = 0 >
|
||||||
@ -19752,7 +19750,8 @@ class basic_json
|
|||||||
|
|
||||||
@since version 3.2.0
|
@since version 3.2.0
|
||||||
*/
|
*/
|
||||||
template < typename BasicJsonType, detail::enable_if_t <
|
template < typename BasicJsonType,
|
||||||
|
detail::enable_if_t <
|
||||||
detail::is_basic_json<BasicJsonType>::value,
|
detail::is_basic_json<BasicJsonType>::value,
|
||||||
int > = 0 >
|
int > = 0 >
|
||||||
BasicJsonType get_impl(detail::priority_tag<2> /*unused*/) const
|
BasicJsonType get_impl(detail::priority_tag<2> /*unused*/) const
|
||||||
@ -19774,7 +19773,8 @@ class basic_json
|
|||||||
|
|
||||||
@since version 2.1.0
|
@since version 2.1.0
|
||||||
*/
|
*/
|
||||||
template<typename BasicJsonType, detail::enable_if_t<
|
template<typename BasicJsonType,
|
||||||
|
detail::enable_if_t<
|
||||||
std::is_same<BasicJsonType, basic_json_t>::value,
|
std::is_same<BasicJsonType, basic_json_t>::value,
|
||||||
int> = 0>
|
int> = 0>
|
||||||
basic_json get_impl(detail::priority_tag<3> /*unused*/) const
|
basic_json get_impl(detail::priority_tag<3> /*unused*/) const
|
||||||
@ -19786,8 +19786,10 @@ class basic_json
|
|||||||
@brief get a pointer value (explicit)
|
@brief get a pointer value (explicit)
|
||||||
@copydoc get()
|
@copydoc get()
|
||||||
*/
|
*/
|
||||||
template<typename PointerType, detail::enable_if_t<
|
template<typename PointerType,
|
||||||
std::is_pointer<PointerType>::value, int> = 0>
|
detail::enable_if_t<
|
||||||
|
std::is_pointer<PointerType>::value,
|
||||||
|
int> = 0>
|
||||||
constexpr auto get_impl(detail::priority_tag<4> /*unused*/) const noexcept
|
constexpr auto get_impl(detail::priority_tag<4> /*unused*/) const noexcept
|
||||||
-> decltype(std::declval<const basic_json_t&>().template get_ptr<PointerType>())
|
-> decltype(std::declval<const basic_json_t&>().template get_ptr<PointerType>())
|
||||||
{
|
{
|
||||||
@ -19820,8 +19822,9 @@ class basic_json
|
|||||||
@since version 2.1.0
|
@since version 2.1.0
|
||||||
*/
|
*/
|
||||||
template < typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>>
|
template < typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>>
|
||||||
constexpr auto get() const noexcept(noexcept(get_impl<ValueType>(detail::priority_tag<4> {})))
|
constexpr auto get() const noexcept(
|
||||||
-> decltype(get_impl<ValueType>(detail::priority_tag<4> {}))
|
noexcept(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {})))
|
||||||
|
-> decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {}))
|
||||||
{
|
{
|
||||||
// we cannot static_assert on ValueTypeCV being non-const, because
|
// we cannot static_assert on ValueTypeCV being non-const, because
|
||||||
// there is support for get<const basic_json_t>(), which is why we
|
// there is support for get<const basic_json_t>(), which is why we
|
||||||
|
Loading…
Reference in New Issue
Block a user