@@ -42,20 +42,21 @@ TEST_CONSTEXPR_CXX26 void verify_insert_return_type(T&& t) {
4242}
4343
4444template <class Container >
45- TEST_CONSTEXPR_CXX26 std::pair<Container, typename Container::node_type>
46- node_factory (typename Container::key_type const & key, typename Container::mapped_type const & mapped) {
47- Container c;
45+ TEST_CONSTEXPR_CXX26 typename Container::node_type
46+ node_factory (Container& c, typename Container::key_type const & key, typename Container::mapped_type const & mapped) {
4847 auto p = c.insert ({key, mapped});
4948 assert (p.second );
50- return {c, c .extract (p.first )} ;
49+ return c .extract (p.first );
5150}
5251
5352template <class Container >
5453TEST_CONSTEXPR_CXX26 void testContainer (Container& c) {
5554 auto * nf = &node_factory<Container>;
5655
56+ Container c2;
57+
5758 for (int i = 0 ; i != 10 ; ++i) {
58- auto [ /* Container */ staticContainer, /* typename Container::node_type*/ node] = nf (i, i + 1 );
59+ typename Container::node_type node = nf (c2, i, i + 1 );
5960 assert (!node.empty ());
6061 typename Container::insert_return_type irt = c.insert (std::move (node));
6162 assert (node.empty ());
@@ -78,7 +79,7 @@ TEST_CONSTEXPR_CXX26 void testContainer(Container& c) {
7879 }
7980
8081 { // Insert duplicate node.
81- auto [ /* Container */ staticContainer, /* typename Container::node_type*/ dupl] = nf (0 , 42 );
82+ typename Container::node_type dupl = nf (c2, 0 , 42 );
8283 auto irt = c.insert (std::move (dupl));
8384 assert (dupl.empty ());
8485 assert (!irt.inserted );
0 commit comments