------- Comment #7 from pcarlini at suse dot de  2007-10-31 00:07 -------
For concreteness would be something like the below (you can try it out, but
consider that the underlying sequence container "emplace" push_back are not
implemented yet, therefore expect only backward compatibility with C++03):

Index: stl_stack.h
===================================================================
--- stl_stack.h (revision 129768)
+++ stl_stack.h (working copy)
@@ -184,14 +184,16 @@
        *  to it.  The time complexity of the operation depends on the
        *  underlying sequence.
        */
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
       void
       push(const value_type& __x)
       { c.push_back(__x); }

-#ifdef __GXX_EXPERIMENTAL_CXX0X__
-      void
-      push(value_type&& __x)
-      { c.push_back(std::move(__x)); }
+#else
+      template<typename... _Args>
+        void
+        push(_Args&&... __args)
+       { c.push_back(std::forward<_Args>(__args)...); }
 #endif

       /**


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33930

Reply via email to