Lines Matching refs:Container

83 template <typename Container>
84 struct Value : ValueFactoryBase<typename Container::key_type, typename Container::value_type> {
86 static bool compare( const typename Container::iterator& it, U val ) {
242 template <typename Container, typename CheckElementState, typename Key>
244 Container cont;
246 std::pair<typename Container::iterator, bool> ins = cont.insert(Value<Container>::make(k1));
248 REQUIRE_MESSAGE(Value<Container>::get(*ins.first) == k1, "Element 1 has not been inserted");
251 typename Container::iterator it2 = cont.insert(ins.first, Value<Container>::make(k2));
252 REQUIRE_MESSAGE(Value<Container>::get(*it2) == k2, "Element 2 has not been inserted");
259 template <typename Container, typename Arg, typename Value>
260 std::pair<typename Container::iterator, bool> call_emplace_impl( Container& c, Arg&& k, Value* ) {
265 template <typename Container, typename Arg, typename FirstType, typename SecondType>
266 std::pair<typename Container::iterator, bool> call_emplace_impl( Container& c, Arg&& k, std::pair<F…
271 template <typename Container, typename Arg, typename Value>
272 typename Container::iterator call_emplace_hint_impl( Container& c, typename Container::const_iterat…
279 template <typename Container, typename Arg, typename FirstType, typename SecondType>
280 typename Container::iterator call_emplace_hint_impl( Container& c, typename Container::const_iterat…
287 template <typename Container, typename Arg>
288 std::pair<typename Container::iterator, bool> call_emplace( Container& c, Arg&& k ) {
289 typename Container::value_type* selector = nullptr;
293 template <typename Container, typename Arg>
294 typename Container::iterator call_emplace_hint( Container& c, typename Container::const_iterator hi…
295 typename Container::value_type* selector = nullptr;
301 template <typename Container, typename CheckElementState, typename Key>
303 Container cont;
305 std::pair<typename Container::iterator, bool> ins = emplace_helpers::call_emplace(cont, key1);
307 REQUIRE_MESSAGE(Value<Container>::compare(ins.first, key1), "Element 1 has not been inserted");
316 typename Container::iterator it2 = emplace_helpers::call_emplace_hint(cont, ins.first, key2);
317 REQUIRE_MESSAGE(Value<Container>::compare(it2, key2), "Element 2 has not been inserted");
321 template <typename Container, typename Iterator, typename Range>
327 sum.second += Value<Container>::get(*i);
333 auto sum1 = CheckRecursiveRange<Container, Iterator>(range);
334 auto sum2 = CheckRecursiveRange<Container, Iterator>(range2);
428 template <typename Range, typename Container>
429 void test_empty_container_range(Container&& cont) {
668 template <typename Container>
670 Container& my_table;
674 using pair_ib = std::pair<typename Container::iterator, bool>;
676 FillTable(Container& table, int items, bool asymptotic)
688 pair_ib pib = my_table.insert(Value<Container>::make(val));
689 REQUIRE_MESSAGE((Value<Container>::get(*(pib.first)) == val),
700 pair_ib pib = my_table.insert(Value<Container>::make(val));
701 REQUIRE_MESSAGE((Value<Container>::get(*(pib.first)) == val),
711 … auto init = { Value<Container>::make(1), Value<Container>::make(1), Value<Container>::make(1) };
713 … REQUIRE_MESSAGE(Value<Container>::get(*my_table.find(1)) == 1, "Element not properly inserted");
715 auto init = { Value<Container>::make(i), Value<Container>::make(i + 2),
716 Value<Container>::make(i + 4) };
718 … REQUIRE_MESSAGE(Value<Container>::get(*my_table.find(i)) == i, "Element i not properly inserted");
719 …REQUIRE_MESSAGE(Value<Container>::get(*my_table.find(i + 2)) == i + 2, "Element i + 2 not properly…
720 …REQUIRE_MESSAGE(Value<Container>::get(*my_table.find(i + 4)) == i + 4, "Element i + 4 not properly…
724 pair_ib pib = my_table.insert(Value<Container>::make(my_asymptotic ? 1 : i));
725 …REQUIRE_MESSAGE(Value<Container>::get(*(pib.first)) == (my_asymptotic ? 1 : i), "Element not prope…
732 typename Container::iterator it = my_table.find(i);
735 … REQUIRE_MESSAGE(Value<Container>::get(*it) == i, "Element not properly inserted");
746 template <typename Container, typename Range>
756 int k = static_cast<int>(Value<Container>::key(*i));
757 REQUIRE(k == Value<Container>::get(*i));
776 template <typename Container>
786 Container table;
788 if (AllowMultimapping<Container>::value) {
796 utils::NativeParallelFor(num_threads, FillTable<Container>(table, items, asymptotic));
804 typename Container::range_type r = table.range();
806 auto p = CheckRecursiveRange<Container, typename Container::iterator>(r);
809 …tbb::parallel_for(r, ParallelTraverseBody<Container, typename Container::range_type>(array, items)…
810 CheckRange(array, items, AllowMultimapping<Container>::value, (num_threads - 1)/2);
812 const Container& const_table = table;
814 typename Container::const_range_type cr = const_table.range();
816 p = CheckRecursiveRange<Container, typename Container::const_iterator>(cr);
819 …tbb::parallel_for(cr, ParallelTraverseBody<Container, typename Container::const_range_type>(array,…
820 CheckRange(array, items, AllowMultimapping<Container>::value, (num_threads - 1) / 2);
823 tbb::parallel_for(0, items, CheckTable<Container>(table));
840 template <typename Container>
844 Container cont;
848 cont.insert(Value<Container>::make(i));
857 template <typename Container>
858 void test_initializer_list_support( std::initializer_list<typename Container::value_type> init ) {
861 test_initializer_list_support_without_assign<Container, TestInsertMethod>(init);
862 test_initializer_list_support_without_assign<Container, TestInsertMethod>({});
1322 template <typename Container>
1324 static_assert(std::is_same<typename Container::key_type, int>::value,
1327 Container c;
1330 c.insert(Value<Container>::make(i));
1333 if (AllowMultimapping<Container>::value) {
1334 c.insert(Value<Container>::make(0));
1347 Container extract_c = c;
1350 if (!AllowMultimapping<Container>::value) {
1354 …SAGE(node_handling_tests::compare_handle_getters(int_key_extract, Value<Container>::make(i)), "Inc…
1362 if (AllowMultimapping<Container>::value) {
1363 Container extract_m;
1365 extract_m.insert(Value<Container>::make(i));
1366 extract_m.insert(Value<Container>::make(i, i + 1));
1372 …SAGE((node_handling_tests::compare_handle_getters(int_key_extract, Value<Container>::make(i, i)) ||
1373 …node_handling_tests::compare_handle_getters(int_key_extract, Value<Container>::make(i, i + 1))), "…
1388 template <typename Container>
1390 static_assert(std::is_same<typename Container::key_type, std::string>::value,
1397 Container c;
1399 c.insert(Value<Container>::make(*it));
1402 if (AllowMultimapping<Container>::value) {
1403 c.insert(Value<Container>::make(*keys.begin()));
1416 Container extract_c = c;
1420 …AGE(node_handling_tests::compare_handle_getters(char_key_extract, Value<Container>::make(*it)), "I…
1428 if (AllowMultimapping<Container>::value){
1429 Container extract_m;
1431 extract_m.insert(Value<Container>::make(keys[i], values[i]));
1432 extract_m.insert(Value<Container>::make(keys[i], values[i + 1]));
1438 …GE((node_handling_tests::compare_handle_getters(char_key_extract, Value<Container>::make(keys[i], …
1439 …node_handling_tests::compare_handle_getters(char_key_extract, Value<Container>::make(keys[i], valu…
1490 template <template <typename...> class Container>
1498 Container<int, int_constructible_object> cont1, cont2;
1499 using iterator = typename Container<int, int_constructible_object>::iterator;
1516 Container<CountingKey, int_constructible_object> counting_cont;
1531 template <typename Container>
1533 …static_assert(std::is_same<typename Container::allocator_type, NotAlwaysEqualAllocator<typename Co…
1535 Container c1{};
1536 Container c2{Value<Container>::make(1), Value<Container>::make(2)};
1538 Container c1_copy = c1;
1539 Container c2_copy = c2;
1548 template <typename Container>
1550 Container c1;
1551 c1.emplace(Value<Container>::make(ThrowOnCopy{}));
1553 using container_allocator_type = std::allocator<Container>;
1556 Container* c2_ptr = alloc_traits::allocate(container_allocator, 1);