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

Method testContainerHelpers

test/value_to.cpp:408–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406 }
407
408 void
409 testContainerHelpers()
410 {
411 {
412 std::vector<int> v;
413 detail::try_reserve(
414 v, 10, detail::reserve_implementation<decltype(v)>());
415 BOOST_TEST(v.capacity() >= 10);
416 BOOST_CORE_STATIC_ASSERT((
417 std::is_same<
418 decltype(detail::inserter(
419 v, detail::inserter_implementation<decltype(v)>())),
420 decltype(std::back_inserter(v)) >::value));
421 }
422 {
423 std::array<int, 2> arr;
424 detail::try_reserve(
425 arr, 2, detail::reserve_implementation<decltype(arr)>());
426 }
427 {
428 int n;
429 detail::try_reserve(
430 n, 5, detail::reserve_implementation<decltype(n)>());
431 }
432 }
433
434 template< class... Context >
435 static

Callers

nothing calls this directly

Calls 3

try_reserveFunction · 0.85
inserterFunction · 0.85
capacityMethod · 0.45

Tested by

no test coverage detected