dbertoni 2002/10/10 18:59:56
Modified: c/src/Include STLHelper.hpp
Log:
Added new functor.
Revision Changes Path
1.5 +36 -0 xml-xalan/c/src/Include/STLHelper.hpp
Index: STLHelper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/Include/STLHelper.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- STLHelper.hpp 6 Apr 2002 07:51:56 -0000 1.4
+++ STLHelper.hpp 11 Oct 2002 01:59:56 -0000 1.5
@@ -185,6 +185,42 @@
/**
+ * Functor to call a clear() member function on its argument.
+ */
+template <class Type>
+#if defined(XALAN_NO_NAMESPACES)
+struct ClearFunctor : public unary_function<Type, void>
+#else
+struct ClearFunctor : public std::unary_function<Type, void>
+#endif
+{
+#if defined(XALAN_NO_NAMESPACES)
+ typedef unary_function<Type, void> BaseClassType;
+#else
+ typedef std::unary_function<Type, void> BaseClassType;
+#endif
+
+ typedef typename BaseClassType::result_type result_type;
+ typedef typename BaseClassType::argument_type argument_type;
+
+ typedef Type
value_type;
+
+ /**
+ * Retrieve the value of a key-value pair.
+ *
+ * @param thePair key-value pair
+ * @return value
+ */
+ result_type
+ operator()(argument_type& theArg) const
+ {
+ theArg.clear();
+ }
+};
+
+
+
+/**
* Functor to delete value objects in maps, used in STL iteration algorithms.
*/
template <class T>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]