C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Templated Circular Buffer Container

From: Phil Bouchard <boost_at_[hidden]>
Date: Wed, 26 Oct 2022 09:19:34 -0400
On 10/26/22 09:04, Dave Brown via Std-Proposals wrote:
> This was earlier proposed as P0059, but appears to have seen little
> work in the last few years.
> Note, however, that this is a span-like container and doesn't own the
> elements. You need to
> create an array and apply the ring_span to it.
>
> I would be interested in seeing this picked up again.
>
> http://wg21.link/p0059
>
> /Dave

Yeah or even better: the ring_span could be a derivative class of any
arbitrary container:

template <typename T, typename C, class Popper = default_popper<T>>

class ring_span : public C

{

    [...]

};

ring_span<std::array<int, 5>> Q(std::begin(A), std::end(A));


>
> On Wed, 26 Oct 2022 at 14:53, Phil Bouchard via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>
> Greetings,
>
> I'm surprised this is not part of the standard library yet:
>
> https://www.boost.org/doc/libs/1_49_0/libs/circular_buffer/doc/circular_buffer.html
>
> As it is 5 times the speed of a deque and list:
>
> https://www.codeproject.com/Articles/1185449/Performance-of-a-Circular-Buffer-vs-Vector-Deque-a
>
> This container is pretty useful as I must have used it 3-4 times
> in different projects over the last 2 years (rotating log files,
> buffering for AI algorithms and preemptive recording of videos).
>
> I encourage its integration because not everybody wants to use the
> Boost library given its complexity to manage.
>
>
> Regards,
>
> --
> Logo <https://www.fornux.com/>
> *Phil Bouchard* facebook icon
> <https://www.linkedin.com/in/phil-bouchard-5723a910/>
> CTO
> T: (819) 328-4743
> E: phil_at_[hidden]| www.fornux.com <http://www.fornux.com>
> 1188 rue Saint-Louis| Gatineau (Qc), J8T 2L8 Canada
>
> Banner <https://goglobalawards.org/> Le message ci-dessus, ainsi
> que les documents l'accompagnant, sont destinés uniquement aux
> personnes identifiées et peuvent contenir des informations
> privilégiées, confidentielles ou ne pouvant être divulguées. Si
> vous avez reçu ce message par erreur, veuillez le détruire.
> This communication (and/or the attachments) is intended for named
> recipients only and may contain privileged or confidential
> information which is not to be disclosed. If you received this
> communication by mistake please destroy all copies.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
>
>
> --
> David Brown
> Puffinpack
> Mobile: +46 735 231 242
>
-- 
Email Signature
Logo <https://www.fornux.com/>  
*Phil Bouchard*  facebook icon 
<https://www.linkedin.com/in/phil-bouchard-5723a910/>
CTO
T: (819) 328-4743
E: phil_at_[hidden]| www.fornux.com <http://www.fornux.com>
1188 rue Saint-Louis| Gatineau (Qc), J8T 2L8 Canada
Banner <https://goglobalawards.org/> Le message ci-dessus, ainsi que les 
documents l'accompagnant, sont destinés uniquement aux personnes 
identifiées et peuvent contenir des informations privilégiées, 
confidentielles ou ne pouvant être divulguées. Si vous avez reçu ce 
message par erreur, veuillez le détruire.
This communication (and/or the attachments) is intended for named 
recipients only and may contain privileged or confidential information 
which is not to be disclosed. If you received this communication by 
mistake please destroy all copies.

Received on 2022-10-26 13:19:35