map<class,int> ?



  • hab ein problem mit einer
    std::map variable
    fehlermeldung:
    In member function `bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = Bitmap]':

    instantiated from `_Tp& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const _Key&) [with _Key = Bitmap, _Tp = int, _Compare = std::less<Bitmap>, _Alloc = std::allocator<std::pair<const Bitmap, int> >]'

    //Bitmap = classe
    //aber bei der definetion sagt er nix
    std::map<Bitmap,int> count;
    Bitmap bitmap;

    if (count[bitmap] == 0){ //hier kommt der fehler vor
    ...
    .....
    ..



  • Für die Klasse Bitmap muß der operator< verfügbar sein, damit die Werte sortiert werden können.



  • ok hab das problem gelöst


Anmelden zum Antworten