C++ Logo


Advanced search

Re: [std-proposals] Fwd: Chaining of the -> operator for std::optional< std::list<T>::iterator >

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Thu, 25 May 2023 15:57:01 +0200
Il 25/05/23 15:32, Frederick Virchanza Gotham via Std-Proposals ha scritto:
> But anyway maybe we could have a new operator such as '->>' which
> stops when it encounters a nullptr.

And produces what exactly?
Again: do you have an actual, concrete proposal, rather than a "it would
be nice if" idea?

> I want the code to be generic so that the container can be changed
> later. I might end up using
> boost::lockfree::single_producer_single_consumer.

Since when Boost.LockFree has iterators?

Changing a container's type is practically never a drop-in, due to
Hyrum's law. *Somewhere* you are relying on the old container's
behaviour, explicitly or implicitly, such as -- case in point -- what
happens regarding iterator invalidation.

My 2 c,
Giuseppe D'Angelo

Received on 2023-05-25 13:57:05