Closed dfaure-kdab closed 1 year ago
In my own class called Node, I wrote
using value_type = std::unique_ptr<AbstractPrintItem>; using const_iterator = std::vector<std::unique_ptr<AbstractPrintItem>>::const_iterator; const_iterator begin() const { return m_printItems.begin(); } const_iterator end() const { return m_printItems.end(); }
This works fine for range-for, and STL algorithms. But kdalgorithms::min_element failed to build with
kdalgorithms.h:214:19: error: ‘const class Node’ has no member named ‘empty’ 214 | if (container.empty())
Shouldn't this be a begin()==end() test instead?
In my own class called Node, I wrote
This works fine for range-for, and STL algorithms. But kdalgorithms::min_element failed to build with
Shouldn't this be a begin()==end() test instead?