Skip to content

Commit

Permalink
Update json_visitor.hpp
Browse files Browse the repository at this point in the history
Avoid the warning from clang:

out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated
  • Loading branch information
MonkeybreadSoftware authored Sep 24, 2023
1 parent 8e77f7c commit ad948b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/jsoncons/json_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,9 @@ namespace jsoncons {
}
};

#if __cplusplus >= 201703L
// not needed for C++17
#else
template <class C> constexpr C basic_json_diagnostics_visitor<C>::visit_begin_array_name[];
template <class C> constexpr C basic_json_diagnostics_visitor<C>::visit_end_array_name[];
template <class C> constexpr C basic_json_diagnostics_visitor<C>::visit_begin_object_name[];
Expand All @@ -1528,6 +1531,7 @@ namespace jsoncons {
template <class C> constexpr C basic_json_diagnostics_visitor<C>::visit_int64_name[];
template <class C> constexpr C basic_json_diagnostics_visitor<C>::visit_half_name[];
template <class C> constexpr C basic_json_diagnostics_visitor<C>::visit_double_name[];
#endif // C++17 check

using json_visitor = basic_json_visitor<char>;
using wjson_visitor = basic_json_visitor<wchar_t>;
Expand Down

0 comments on commit ad948b3

Please sign in to comment.