19#if !defined(TAGVAL_WITH_NLOHMANN_JSON)
20#if __has_include(<nlohmann/json.hpp>)
21#define TAGVAL_WITH_NLOHMANN_JSON 1
23#define TAGVAL_WITH_NLOHMANN_JSON 0
27#if TAGVAL_WITH_NLOHMANN_JSON
32#include <nlohmann/json.hpp>
41 requires std::derived_from<T, detail::TagValBaseTag>
42inline void to_json(::nlohmann::json& j,
const T& v) {
43 j = std::string{v.code()};
47 requires std::derived_from<T, detail::TagValBaseTag>
48inline void from_json(const ::nlohmann::json& j, T& v) {
49 const auto s = j.get<std::string>();
50 auto exp = T::try_of(std::string_view{s});
CRTP HandleBase used by ClosedEnded and OpenEnded.
Thrown by of() when a code is not present.
Definition error.hpp:19
tagval exception types and ParseError record used by try_of().
void to_json(::nlohmann::json &j, const T &v)
Definition json_nlohmann.hpp:42
void from_json(const ::nlohmann::json &j, T &v)
Definition json_nlohmann.hpp:48