77//
88
99#include < boost/json/parse_into.hpp>
10+ #include < boost/variant2/variant.hpp>
1011#include < boost/describe.hpp>
1112#include < map>
1213
13- #ifndef BOOST_NO_CXX17_HDR_VARIANT
14- # include < variant>
15- # define IF_CXX17_HDR_VARIANT (...) __VA_ARGS__
16- #else
17- # define IF_CXX17_HDR_VARIANT (...)
18- #endif // BOOST_NO_CXX17_HDR_VARIANT
19-
2014#ifndef BOOST_NO_CXX17_HDR_OPTIONAL
2115# include < optional>
2216# define IF_CXX17_HDR_OPTIONAL (...) __VA_ARGS__
@@ -46,10 +40,7 @@ struct Object
4640 std::tuple<bool , std::uint64_t , std::int64_t , double , std::string> t1;
4741 std::tuple<std::array<std::string, 3 >, std::array<double , 3 >, std::nullptr_t > t2;
4842 std::tuple<std::vector<std::string>, std::vector<double >> t3;
49-
50- #ifndef BOOST_NO_CXX17_HDR_VARIANT
51- std::variant<bool , std::uint64_t , std::int64_t , double , std::string> v;
52- #endif // BOOST_NO_CXX17_HDR_VARIANT
43+ boost::variant2::variant<bool , std::uint64_t , std::int64_t , double , std::string> v;
5344
5445#ifndef BOOST_NO_CXX17_HDR_OPTIONAL
5546 std::optional<bool > ob;
@@ -61,8 +52,9 @@ struct Object
6152};
6253
6354BOOST_DESCRIBE_STRUCT (Object, (),
64- (b, i64 , u64 , f, d, s, v1, v2, v3, a1, a2, a3, m1, m2, m3, t1, t2, t3,
65- IF_CXX17_HDR_OPTIONAL (ob, oi, ou, od, os), IF_CXX17_HDR_OPTIONAL(v)))
55+ (b, i64 , u64 , f, d, s, v1, v2, v3, a1, a2, a3, m1, m2, m3, t1, t2, t3, v,
56+ IF_CXX17_HDR_OPTIONAL (ob, oi, ou, od, os)))
57+
6658
6759bool
6860fuzz_direct_parse(string_view sv)
0 commit comments