Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54509 - in sandbox/monotonic: boost/heterogenous libs/monotonic/test/clones
From: christian.schladetsch_at_[hidden]
Date: 2009-06-29 18:46:22


Author: cschladetsch
Date: 2009-06-29 18:46:21 EDT (Mon, 29 Jun 2009)
New Revision: 54509
URL: http://svn.boost.org/trac/boost/changeset/54509

Log:
renamed vector::push_back to emplace_back

Text files modified:
   sandbox/monotonic/boost/heterogenous/vector.hpp | 10 +++++-----
   sandbox/monotonic/libs/monotonic/test/clones/tests.cpp | 6 +++---
   2 files changed, 8 insertions(+), 8 deletions(-)

Modified: sandbox/monotonic/boost/heterogenous/vector.hpp
==============================================================================
--- sandbox/monotonic/boost/heterogenous/vector.hpp (original)
+++ sandbox/monotonic/boost/heterogenous/vector.hpp 2009-06-29 18:46:21 EDT (Mon, 29 Jun 2009)
@@ -170,27 +170,27 @@
 
                         // TODO: use variadic arguments or BOOST_PP to pass ctor args
                         template <class U>
- void push_back()
+ void emplace_back()
                         {
                                 U *ptr = construct_type<U>();
- impl.push_back(ptr);
+ impl.emplace_back(ptr);
                         }
                         template <class U, class A0>
- void push_back(A0 a0)
+ void emplace_back(A0 a0)
                         {
                                 U *ptr = allocate_type<U>();
                                 new (ptr) U(a0);
                                 impl.push_back(ptr);
                         }
                         template <class U, class A0, class A1>
- void push_back(A0 a0, A1 a1)
+ void emplace_back(A0 a0, A1 a1)
                         {
                                 U *ptr = allocate_type<U>();
                                 new (ptr) U(a0, a1);
                                 impl.push_back(ptr);
                         }
                         template <class U, class A0, class A1, class A2>
- void push_back(A0 a0, A1 a1, A2 a2)
+ void emplace_back(A0 a0, A1 a1, A2 a2)
                         {
                                 U *ptr = allocate_type<U>();
                                 new (ptr) U(a0, a1, a2);

Modified: sandbox/monotonic/libs/monotonic/test/clones/tests.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/clones/tests.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/clones/tests.cpp 2009-06-29 18:46:21 EDT (Mon, 29 Jun 2009)
@@ -80,9 +80,9 @@
 
                 // type of thing to insert must be passed explicitly, and must derive from common_base.
                 // arguments to push_back are passed directly to ctor
- bases.push_back<derived>(42);
- bases.push_back<derived2>("foo");
- bases.push_back<derived3>(3.14f, -123, "spam");
+ bases.emplace_back<derived>(42);
+ bases.emplace_back<derived2>("foo");
+ bases.emplace_back<derived3>(3.14f, -123, "spam");
 
                 // perform functor on each contained object of the given type
                 bases.for_each<derived3>(boost::bind(&derived3::print, _1));


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk