Commit 6eb37e9b by Anthony VH

Only add conditional constexpr to get() for >= C++14 to work around errors on older compilers.

parent d7c0f157
...@@ -3063,7 +3063,10 @@ class basic_json ...@@ -3063,7 +3063,10 @@ 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( #if defined(JSON_HAS_CPP_14)
constexpr
#endif
auto get() const noexcept(
noexcept(std::declval<const basic_json_t&>().template 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> {})) -> decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {}))
{ {
......
...@@ -19815,7 +19815,10 @@ class basic_json ...@@ -19815,7 +19815,10 @@ 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( #if defined(JSON_HAS_CPP_14)
constexpr
#endif
auto get() const noexcept(
noexcept(std::declval<const basic_json_t&>().template 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> {})) -> decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {}))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment