I'm trying to create something like an analogue for Python's list
. There are some objects derived from class Object
. There is also class List
, which is just a overlay for std::vector<Object*>
. All classes have clone
function (as well as some other functions). Now I'm trying to provide a possibility to find an index for the given element (like Python's list.index
). It would be also great to provide a possibility to sort in future, i.e. to compare objects inside List
class. How can I realise it without having to overload operator==
? I've heard about hashing algorithms. Is it the thing that I'm looking for? If yes, could you advice a library or (better) how can I implement it using raw C++?
Thanks in advance!