[Aptitude-svn-commit] r3841 - in branches/aptitude-0.3/aptitude: .
src/generic/problemresolver
Daniel Burrows
dburrows at costa.debian.org
Mon Aug 15 19:18:18 UTC 2005
Author: dburrows
Date: Mon Aug 15 19:18:15 2005
New Revision: 3841
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/generic/problemresolver/solution.h
Log:
Write proper operator== and operator!= for solutions.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Mon Aug 15 19:18:15 2005
@@ -1,5 +1,10 @@
2005-08-15 Daniel Burrows <dburrows at debian.org>
+ * src/generic/problemresolver/solution.h:
+
+ Write operator== and operator!= that obey the rule about action
+ identities being based on the version installed.
+
* src/generic/problemresolver/problemresolver.h:
Add missing conditionalization (only dump information about soft
Modified: branches/aptitude-0.3/aptitude/src/generic/problemresolver/solution.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/problemresolver/solution.h (original)
+++ branches/aptitude-0.3/aptitude/src/generic/problemresolver/solution.h Mon Aug 15 19:18:15 2005
@@ -44,7 +44,10 @@
typedef typename PackageUniverse::dep dep;
/** Represents a single action taken by the resolver: the
- * installation of a particular version of a package.
+ * installation of a particular version of a package. The
+ * *identity* of an action (in terms of operator< and operator==)
+ * is based solely on the version it installs, although additional
+ * information is provided to "tag" it.
*/
struct action
{
@@ -65,6 +68,16 @@
int _id):ver(_ver), d(_d), id(_id) {}
bool operator<(const action &other) const {return ver<other.ver;}
+
+ bool operator==(const action &other) const
+ {
+ return ver == other.ver;
+ }
+
+ bool operator!=(const action &other) const
+ {
+ return ver != other.ver;
+ }
};
private:
More information about the Aptitude-svn-commit
mailing list