This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[libstdc++ 3.1] Move push_back() patch to branch
- From: Phil Edwards <phil at jaj dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 8 Mar 2002 13:54:41 -0500
- Subject: [libstdc++ 3.1] Move push_back() patch to branch
This deprecates the no-argument vector::push_back() on the 3.1 branch;
the patch has been living happily on trunk for a few days now. Tested with
no regressions.
2002-03-08 Phil Edwards <pme@gcc.gnu.org>
PR libstdc++/5734
* include/bits/stl_vector.h (vector::push_back()): Guard with
_GLIBCPP_DEPRECATED.
Index: include/bits/stl_vector.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_vector.h,v
retrieving revision 1.17
diff -u -3 -p -r1.17 stl_vector.h
--- stl_vector.h 2002/02/08 02:19:06 1.17
+++ stl_vector.h 2002/03/08 18:53:44
@@ -1,6 +1,6 @@
// Vector implementation -*- C++ -*-
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -484,9 +484,13 @@ public:
_M_insert_aux(end(), __x);
}
+#ifdef _GLIBCPP_DEPRECATED
/**
* Add an element to the end of the vector. The element is
* default-constructed.
+ *
+ * @note You must define _GLIBCPP_DEPRECATED to make this visible; see
+ * c++config.h.
*/
void
push_back()
@@ -498,6 +502,7 @@ public:
else
_M_insert_aux(end());
}
+#endif
void
swap(vector<_Tp, _Alloc>& __x)