[Aptitude-svn-commit] r4000 - in branches/aptitude-0.3/aptitude: . src/generic

Daniel Burrows dburrows at costa.debian.org
Tue Aug 30 20:06:05 UTC 2005


Author: dburrows
Date: Tue Aug 30 20:06:02 2005
New Revision: 4000

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/util.h
Log:
Add project1st.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Aug 30 20:06:02 2005
@@ -2,6 +2,10 @@
 
 	* src/generic/util.h:
 
+	  Also add project1st.
+
+	* src/generic/util.h:
+
 	  Add some missing functor classes that are in libstdc++ but
 	  aren't standard.
 

Modified: branches/aptitude-0.3/aptitude/src/generic/util.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/util.h	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/util.h	Tue Aug 30 20:06:02 2005
@@ -63,6 +63,26 @@
   }
 };
 
+/** A function object that returns its first argument. */
+template<typename T1, typename T2>
+struct project1st
+{
+  T1 operator()(const T1 &t1, const T2 &t2) const
+  {
+    return t1;
+  }
+};
+
+/** A function object that returns its second argument. */
+template<typename T1, typename T2>
+struct project2nd
+{
+  T2 operator()(const T1 &t1, const T2 &t2) const
+  {
+    return t2;
+  }
+};
+
 /** A function object that extracts the first element from a pair. */
 template<typename T1, typename T2>
 struct select1st



More information about the Aptitude-svn-commit mailing list