Im including but get unknown type name ‘iterator’

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

class AlgoContainer{
    std::vector<Task> allTasks;
    void sort();
    AlgoContainer() = default;
    void addTask(const Task);
    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