dbcppp
dbcppp copied to clipboard
const iterator
I would suggest to add a const iterator to class Iterable besides to the modifiable iterator. Example for https://github.com/xR3b0rn/dbcppp/blob/master/include/dbcppp/Iterator.h
template <class Iterator>
class Iterable
{
public:
Iterable(Iterator begin, Iterator end)
: _begin(begin)
, _end(end)
{}
Iterator& begin()
{
return _begin;
}
Iterator& end()
{
return _end;
}
const Iterator& const_begin() const
{
return _begin;
}
const Iterator& const_end() const
{
return _end;
}
private:
Iterator _begin;
Iterator _end;
};
Reason: accessing a (const dbcppp::IMessage*)->Signals() with begin()/end(), the compiler ends up with the error that begin()/end() are not marked as const.