PacktPublishing / Template-Metaprogramming-with-CPP

Template Metaprogramming with C++, published by Packt
MIT License
90 stars 27 forks source link

circular_buffer_iterator lacking constructor for const buffer #8

Open bloomen opened 1 year ago

bloomen commented 1 year ago

circular_buffer_iterator has a constructor for non-const buffer at: https://github.com/PacktPublishing/Template-Metaprogramming-with-CPP/blob/a9e4c85307834a2a200d278b0429b147dc738786/src/chapter_08/main.cpp#L197 but not for a const buffer. Doesn't this mean that:

const_reference begin() const
{
    return const_iterator(*this, 0);
}

won't compile?