boostorg / boostorg/circular_buffer

feat: modifying functions having iterators as input should be overloaded with functions taking const_iterator

Offen
#47 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
65
Forks
64
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

This is what most standard containers are doing today.

By replacing std::deque with boost::circular, I got a few compilation errors...

Prior to C++11, the guideline was to prefer iterator because of some STL API defect in regard to const_iterator but this got fixed in C++11

References:
Effective STL book
item 26: Prefer iterator to const_iterator, reverse_iterator, and const_reverse_iterator

Effective Modern C++ book
Item 13: Prefer const_iterators to iterators

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by inspecting the circular_buffer API for functions that accept iterator inputs and compare their overloads with standard-container conventions. Reproduce the compilation errors described when replacing std::deque with boost::circular, then define done as providing the needed const_iterator-compatible overloads without breaking existing iterator calls.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
backend-api-design
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.