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

Method testTrySize

test/value_from.cpp:493–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491 }
492
493 void
494 testTrySize()
495 {
496 {
497 std::vector<int> v{1, 2, 3};
498 using impl = detail::size_implementation<decltype(v)>;
499 BOOST_TEST(detail::try_size(v, impl()) == 3);
500 }
501 {
502 int arr[4] = {1, 2, 3, 4};
503 using impl = detail::size_implementation<decltype(arr)>;
504 BOOST_TEST(detail::try_size(arr, impl()) == 4);
505 }
506 {
507 value_from_test_ns::T6 t;
508 using impl = detail::size_implementation<decltype(t)>;
509 BOOST_TEST(detail::try_size(t, impl()) == 3);
510 }
511 {
512 value_from_test_ns::T1 t;
513 using impl = detail::size_implementation<decltype(t)>;
514 BOOST_TEST(detail::try_size(t, impl()) == 0);
515 }
516 }
517
518 template< class... Context >
519 static

Callers

nothing calls this directly

Calls 1

try_sizeFunction · 0.85

Tested by

no test coverage detected