You're declaring a second CmpTabletKey
inside the class
ObjectFinder
; when instantiating the map, you're inside the
class, so this is the one the compiler finds. Just drop the
class CmpTabletKey;
statement inside the class (or change it
to a typedef to ::CmpTabletKey
, or move the entire definition
of CmpTabletKey
inside the class ObjectFinder
.
Also, you're comparison function looks a bit strange. It looks
to me that it can only return true
if the keys are equal,
which doesn't define an ordering relationship. If you just want
to compare the first field:
bool operator()( TabletKey const& lhs, TabletKey const& rhs ) const
{
return lhs.first < rhs.first;
}
should do the trick.