]> granicus.if.org Git - libmatroska/commit
Properly compare elements
authorMoritz Bunkus <moritz@bunkus.org>
Sat, 27 Mar 2010 23:15:21 +0000 (23:15 +0000)
committerMoritz Bunkus <moritz@bunkus.org>
Sat, 27 Mar 2010 23:15:21 +0000 (23:15 +0000)
commite9c742ec1c14f95111d9489d944d76648b896b69
tree53ba3f08498e6237fec0af20e1c511f57d3a9da5
parent300fb5b4b724da1b5f6dfcd6dda940a7627ca8a9
Properly compare elements

If you have "virtual operator <" in a base class and a derived
class and each takes a reference of its own class as an arugment
then the function in the derived class hides the one in the base
class and does not override is as the signatures do not match:

class base {
public:
  bool virtual operator <(const base &cmp);
};
class derived: public base {
public:
  bool virtual operator <(const derived &cmp);
};

If two instances of base are compared then base::operator< is called:

base *p1, *p2;
if (*p1 < *p2) // calls base::operator<

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libmatroska@62 a6f86f6d-0131-4f8e-9e7b-e335508773d5
matroska/KaxCuesData.h
src/KaxCuesData.cpp