C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Should std::atomic<T*> have operator->?
From: Thiago Macieira (thiago_at_[hidden])
Date: 2019-10-22 10:00:20


On Tuesday, 22 October 2019 00:14:52 PDT Andrey Semashev via Std-Discussion
wrote:
> > Sometimes it can
> >
> > void f()
> > {
> >
> > std::atomic_ptr<MyType> ptr = get_object();
> > ptr->do_one_thing();
> > ptr->do_another_thing();
> >
> > }
>
> In such pathologic cases I question whether atomic is needed in the
> first place.

You're probably right, but it's easy to see how it would happen if the atomic
is a member of a class.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups