MCPcopy Create free account
hub / github.com/boostorg/json / check_nonref

Method check_nonref

test/visit.cpp:269–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268 template<class T>
269 void
270 check_nonref(
271 kind k,
272 T t,
273 boost::source_location const& loc = BOOST_CURRENT_LOCATION)
274 {
275 struct f
276 {
277 kind k;
278 bool operator()(std::nullptr_t) && { return k == kind::null; }
279 bool operator()(bool) && { return k == kind::bool_; }
280 bool operator()(std::int64_t) && { return k == kind::int64; }
281 bool operator()(std::uint64_t) && { return k == kind::uint64; }
282 bool operator()(double) && { return k == kind::double_; }
283 bool operator()(string) && { return k == kind::string; }
284 bool operator()(array) && { return k == kind::array; }
285 bool operator()(object) && { return k == kind::object; }
286 bool operator()(...) const { return false; }
287 };
288 value v(t);
289 f f_{k};
290 BOOST_TEST( visit(std::move(f_), std::move(v)), loc );
291 }
292
293 void run()
294 {

Callers

nothing calls this directly

Calls 1

visitFunction · 0.85

Tested by

no test coverage detected