svn commit: trunk/uClibc++/include

gkajmowi at uclibc.org gkajmowi at uclibc.org
Fri Oct 6 20:49:09 UTC 2006


Author: gkajmowi
Date: 2006-10-06 13:49:09 -0700 (Fri, 06 Oct 2006)
New Revision: 16326

Log:
Add operator== to stack instead of global operator.  This violates spec, but gets around compiler complaints about
accessibility of internal objects the compiler is giving me.




Modified:
   trunk/uClibc++/include/stack


Changeset:
Modified: trunk/uClibc++/include/stack
===================================================================
--- trunk/uClibc++/include/stack	2006-10-06 20:48:06 UTC (rev 16325)
+++ trunk/uClibc++/include/stack	2006-10-06 20:49:09 UTC (rev 16326)
@@ -26,6 +26,7 @@
 	template <class T, class Container = deque<T> > class _UCXXEXPORT stack{
 	protected:
 		Container c;
+
 	public:
 		typedef typename Container::value_type	value_type;
 		typedef typename Container::size_type	size_type;
@@ -38,17 +39,15 @@
 		const value_type& top() const { return c.back(); }
 		void push(const value_type& x) { c.push_back(x); }
 		void pop() { c.pop_back(); }
-	};
 
+		bool operator==(const stack<T, Container> &x) const{
+			return  x.c == c;
+		}
 
+	};
 
 
 	template <class T, class Container> _UCXXEXPORT bool
-		operator==(const stack<T, Container>& x, const stack<T, Container>& y)
-	{
-		return (x.c == y.c);
-	}
-	template <class T, class Container> _UCXXEXPORT bool
 		operator< (const stack<T, Container>& x, const stack<T, Container>& y)
 	{
 		return (x.c < y.c);




More information about the uClibc-cvs mailing list