mardi 5 mai 2020

Why doesnt this function overide the base class function

So here is the base class:

class MovieRepo {
protected:
    MyLista<Movie> all;
public:
    MovieRepo();
    void store(const Movie& m);
}

And this one is the override:

class RepoFile : public MovieRepo
{
private:
    string filename;
    void loadFromFile();
    void storeToFile();

public:

    RepoFile(string _filename) : filename{ _filename } { this->loadFromFile(); };

    void store(const Movie& m) override { // here is the error
        MovieRepo::store(m);
        storeToFile();
    }
}

It says:'RepoFile::store': method with override specifier 'override' did not override any base class methods

Aucun commentaire:

Enregistrer un commentaire