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

Method testOptional

test/value_from.cpp:549–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547
548 template< class... Context >
549 static
550 void testOptional( Context const& ... ctx )
551 {
552 ignore_unused( ctx... );
553#ifndef BOOST_NO_CXX17_HDR_OPTIONAL
554 std::vector<std::optional<int>> opts{1, 2, 3, {}, 5};
555 value jv = value_from( opts, ctx... );
556 BOOST_TEST( jv == (value{1, 2, 3, nullptr, 5}) );
557
558 BOOST_TEST( value_from( std::nullopt, ctx... ).is_null() );
559#endif
560 }
561
562 template< class... Context >
563 static

Callers

nothing calls this directly

Calls 2

value_fromFunction · 0.85
is_nullMethod · 0.80

Tested by

no test coverage detected