MCPcopy Create free account
hub / github.com/boostorg/leaf / boost_json_encoder_

Class boost_json_encoder_

include/boost/leaf/serialization/boost_json_encoder.hpp:25–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23{
24 template <class Value = boost::json::value>
25 struct boost_json_encoder_
26 {
27 Value & v_;
28
29 template <class Encoder, class T, class... Deprioritize>
30 friend typename std::enable_if<std::is_same<Encoder, boost_json_encoder_>::value>::type
31 output(Encoder & e, T const & x, Deprioritize...)
32 {
33 boost::json::value_from(x, e.v_);
34 }
35
36 template <class T>
37 friend void output_at(boost_json_encoder_ & e, T const & x, char const * name)
38 {
39 if( e.v_.is_null() )
40 e.v_.emplace_object();
41 boost_json_encoder_ nested{e.v_.as_object()[name]};
42 output(nested, x);
43 }
44 };
45
46 using boost_json_encoder = boost_json_encoder_<>;
47}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected