You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/05/11 21:03:00 UTC
cvs commit: xml-xalan/c/src/PlatformSupport STLHelper.hpp
dbertoni 00/05/11 12:03:00
Modified: c/src/PlatformSupport STLHelper.hpp
Log:
Cleaned up some unused code and added typename keyword to some templates.
Revision Changes Path
1.6 +16 -118 xml-xalan/c/src/PlatformSupport/STLHelper.hpp
Index: STLHelper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/STLHelper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- STLHelper.hpp 2000/04/11 14:35:30 1.5
+++ STLHelper.hpp 2000/05/11 19:03:00 1.6
@@ -82,8 +82,8 @@
*
* @param thePointer pointer to object to be deleted
*/
- result_type
- operator()(argument_type thePointer) const
+ typename result_type
+ operator()(typename argument_type thePointer) const
{
delete thePointer;
}
@@ -142,7 +142,7 @@
struct select1st : public std::unary_function<PairType, PairType::first_type>
#endif
{
- typedef PairType value_type;
+ typedef typename PairType value_type;
/**
* Retrieve the key of a key-value pair.
@@ -150,8 +150,8 @@
* @param thePair key-value pair
* @return key
*/
- result_type
- operator()(const argument_type& thePair) const
+ typename result_type
+ operator()(const typename argument_type& thePair) const
{
return thePair.first;
}
@@ -170,7 +170,7 @@
struct select2nd : public std::unary_function<PairType, PairType::second_type>
#endif
{
- typedef PairType value_type;
+ typedef typename PairType value_type;
/**
* Retrieve the value of a key-value pair.
@@ -178,8 +178,8 @@
* @param thePair key-value pair
* @return value
*/
- result_type
- operator()(const argument_type& thePair)
+ typename result_type
+ operator()(const typename argument_type& thePair)
{
return thePair.second;
}
@@ -187,95 +187,8 @@
#endif
-/*
-$$$ What's it all mean ???
-*/
-template <class OutputIteratorType, class PairMemberSelectType>
-struct PairIsolatorOutputIterator
-{
-
-/*
-#if defined(XALAN_NO_NAMESPACES)
- typedef output_iterator_tag iterator_category;
-#else
- typedef std::output_iterator_tag iterator_category;
-#endif
-*/
-
- typedef typename PairMemberSelectType::value_type value_type;
-
-/*
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-*/
-
- PairIsolatorOutputIterator(
- OutputIteratorType theOutputIterator,
- PairMemberSelectType thePairMemberSelector) :
- m_OutputIterator(theOutputIterator),
- m_PairMemberSelector(thePairMemberSelector)
- {
- }
-
- /**
- * Changes the output iterator member based on a value.
- *
- * @param theValue value to use
- * @return this object
- */
- PairIsolatorOutputIterator&
- operator=(const value_type& theValue)
- {
- m_OutputIterator = m_PairMemberSelector(theValue);
-
- return *this;
- }
-
- /**
- * Retrieve the object.
- *
- * @return this object
- */
- PairIsolatorOutputIterator&
- operator*()
- {
- return *this;
- }
-
- /**
- * Increments the output iterator member.
- *
- * @return this object
- */
- PairIsolatorOutputIterator&
- operator++()
- {
- ++m_OutputIterator;
- return *this;
- }
- /**
- * Increments the output iterator member.
- *
- * @return this object
- */
- PairIsolatorOutputIterator& operator++(int)
- {
- m_OutputIterator++;
-
- return *this;
- }
-
-private:
-
- OutputIteratorType m_OutputIterator;
- PairMemberSelectType m_PairMemberSelector;
-};
-
-
-
/**
* Functor to delete value objects in maps, used in STL iteration algorithms.
*/
@@ -292,8 +205,8 @@
*
* @param thePair key-value pair
*/
- result_type
- operator()(argument_type thePair)
+ typename result_type
+ operator()(typename argument_type thePair)
{
delete thePair.second;
}
@@ -323,8 +236,8 @@
*
* @param thePair key-value pair
*/
- result_type
- operator()(argument_type thePair)
+ typename result_type
+ operator()(typename argument_type thePair)
{
delete thePair.first;
}
@@ -370,7 +283,7 @@
* @param theContainer container object
*/
typename T::result_type
- operator()(argument_type theContainer)
+ operator()(typename argument_type theContainer)
{
return for_each(theContainer.begin(),
theContainer.end(),
@@ -384,21 +297,6 @@
-// $$$ ???
-/*
-template <class InputIterator, class Function>
-Function
-nested_for_each(
- InputIterator first,
- InputIterator last,
- Function function)
-{
-
- return function;
-}
-*/
-
-
/**
* This functor is designed to compare 0-terminated arrays. It substitutes
* for the default less<type*> so that pointers to arrays can be compared,
@@ -423,9 +321,9 @@
* @param theRHS second object to compare
* @return true if objects are the same
*/
- result_type
- operator()(first_argument_type theLHS,
- second_argument_type theRHS) const
+ typename result_type
+ operator()(typename first_argument_type theLHS,
+ typename second_argument_type theRHS) const
{
while(*theLHS && *theRHS)
{