stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r692756 - /stdcxx/branches/4.2.x/examples/manual/stack.cpp
Date Sat, 06 Sep 2008 22:41:46 GMT
Author: sebor
Date: Sat Sep  6 15:41:46 2008
New Revision: 692756

URL: http://svn.apache.org/viewvc?rev=692756&view=rev
Log:
2008-09-06  Martin Sebor  <sebor@roguewave.com>

	STDCXX-1007
	* examples/manual/stack.cpp (main): Silenced HP aCC warning #4320:
	performance advice: std::endl is expensive because it flushes the
	stream.
	Also silenced remark #4271-D: type conversion may lose sign.

Modified:
    stdcxx/branches/4.2.x/examples/manual/stack.cpp

Modified: stdcxx/branches/4.2.x/examples/manual/stack.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/examples/manual/stack.cpp?rev=692756&r1=692755&r2=692756&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/examples/manual/stack.cpp (original)
+++ stdcxx/branches/4.2.x/examples/manual/stack.cpp Sat Sep  6 15:41:46 2008
@@ -22,7 +22,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2006 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -41,13 +41,14 @@
   //
   // Make a stack using a vector container.
   //
-  stack<int,vector<int,allocator<int> > > s;
+  typedef stack<int,vector<int,allocator<int> > > IntStack;
+  IntStack s;
   //
   // Push a couple of values on the stack.
   //
   s.push(1);
   s.push(2);
-  cout << s.top() << endl;
+  cout << s.top() << '\n';
   //
   // Now pop them off.
   //
@@ -61,7 +62,7 @@
   //
   // Push a bunch of strings on then pop them off.
   //
-  int i;
+  IntStack::size_type i;
   for (i = 0; i < 10; i++)
   {
     ss.push(string(i+1,'a'));



Mime
View raw message