Im including but get unknown type name ‘iterator’

I was able to solve this by changing my header file to be

class AlgoContainer{
private:
    std::vector<Task> allTasks;
    void sort();
public:
    AlgoContainer() = default;
    void addTask(const Task);
    ~AlgoContainer();
    //CHANGE HERE
    using iterator = decltype(allTasks)::const_iterator;
    iterator begin() const;
    iterator end() const;

};

What is the consensus on whether this is frowned upon or not?

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top