Update of /cvsroot/mockpp/mockpp/mockpp/constraint
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32168/mockpp/constraint
Modified Files:
IsEqual.h
Log Message:
added comparison template
Index: IsEqual.h
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/constraint/IsEqual.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- IsEqual.h 23 Sep 2005 21:32:38 -0000 1.20
+++ IsEqual.h 1 Oct 2005 16:25:00 -0000 1.21
@@ -43,6 +43,22 @@
namespace mockpp {
+/** Default comparison function for \c IsEqual.
+ * The default implementation compares the values of the two
+ * objects.
+ * @ingroup grp_constraint
+ * @see mockpp::IsEqual
+ * @param left left operand
+ * @param right right operand
+ * @return true if both values are equal
+ */
+template <class T>
+bool isEqualComparison(const T &left, const T &right)
+{
+ return left == right;
+}
+
+
/** Is the value equal to another value, as tested by the
* invoked method? Basically the same as \c IsSame which compares
* by reference and a specializable comparison template.
@@ -74,7 +90,7 @@
*/
virtual bool eval( const T &arg ) const
{
- return ref == arg;
+ return isEqualComparison(arg, ref);
}
/** Appends the description of this object to the buffer.
|