@@ -280,6 +280,7 @@ void cxx11_allocator_test() {
280280 CB_CONTAINER<MyInteger, cxx11_allocator<MyInteger> > cb (10 , 0 );
281281 generic_test (cb);
282282}
283+
283284#endif
284285
285286void begin_and_end_test () {
@@ -1150,6 +1151,32 @@ void pop_back_test() {
11501151 generic_test (cb);
11511152}
11521153
1154+ void emplace_test (){
1155+ CB_CONTAINER<MyInteger> cb (4 );
1156+ cb.emplace_back (4 );
1157+ cb.emplace_back (5 );
1158+ cb.emplace_back (6 );
1159+ cb.emplace_back (7 );
1160+
1161+ BOOST_CHECK (cb.size () == 4 );
1162+ BOOST_CHECK (cb.front () == 4 );
1163+ BOOST_CHECK (cb.back () == 7 );
1164+
1165+ cb.emplace_front (3 );
1166+ cb.emplace_front (2 );
1167+
1168+ BOOST_CHECK (cb.front () == 2 );
1169+ BOOST_CHECK (cb.back () == 5 );
1170+
1171+ cb.emplace_front (1 );
1172+ cb.emplace_front (0 );
1173+
1174+ BOOST_CHECK (cb.size () == 4 );
1175+ BOOST_CHECK (*cb.begin () == 0 );
1176+ BOOST_CHECK (cb.front () == 0 );
1177+ BOOST_CHECK (cb.back () == 3 );
1178+ }
1179+
11531180void insert_test () {
11541181
11551182 CB_CONTAINER<MyInteger> cb1 (4 );
@@ -2453,6 +2480,7 @@ void add_common_tests(test_suite* tests) {
24532480 tests->add (BOOST_TEST_CASE (&swap_test));
24542481 tests->add (BOOST_TEST_CASE (&push_back_test));
24552482 tests->add (BOOST_TEST_CASE (&pop_back_test));
2483+ tests->add (BOOST_TEST_CASE (&emplace_test));
24562484 tests->add (BOOST_TEST_CASE (&insert_test));
24572485 tests->add (BOOST_TEST_CASE (&insert_n_test));
24582486 tests->add (BOOST_TEST_CASE (&insert_range_test));
0 commit comments