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

Method testVariant

test/value_from.cpp:563–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561
562 template< class... Context >
563 static
564 void
565 testVariant( Context const& ... ctx )
566 {
567 ignore_unused( ctx... );
568#ifndef BOOST_NO_CXX17_HDR_VARIANT
569 std::variant<int, ::value_from_test_ns::T5, double> v = 4;
570 value jv = value_from( v, ctx... );
571 BOOST_TEST(jv == 4);
572
573 v = 0.5;
574 jv = value_from( v, ctx... );
575 BOOST_TEST(jv == 0.5);
576
577 v = ::value_from_test_ns::T5{};
578 jv = value_from( v, ctx... );
579 BOOST_TEST(jv == "T5");
580
581 BOOST_TEST( value() == value_from( std::monostate(), ctx... ) );
582#endif // BOOST_NO_CXX17_HDR_VARIANT
583 }
584
585 template< class... Context >
586 static

Callers

nothing calls this directly

Calls 2

value_fromFunction · 0.85
valueClass · 0.70

Tested by

no test coverage detected