C++ Logo

std-discussion

Advanced search

Re: when to std::launder

From: Nicolas Lesser <blitzrakete_at_[hidden]>
Date: Mon, 29 Apr 2019 17:38:58 +0200
Larry Evans via Std-Discussion wrote:
> Hi Nicolas,
>
> On 4/29/19 7:14 AM, Nicolas Lesser via Std-Discussion wrote:
> > char buffer[sizeof(C)]; is not reassignable.
>
> That's an example of something that has some property,
> that's not a definition of that property.
>
> For example, is:
>
> char buffer[2]; also not reassignable?
>
> Searching:
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/n4800.pdf
>
> showed no occurrence of reassignable.
>
> Could you please define more specifically what "reassignable" means?
>
> TIA.
>
> -regards,
> Larry
>
> >
> > On Mon, Apr 29, 2019, 12:07 PM Mohamed Khaled <mkmostafa92_at_[hidden]> wrote:
> >
> >> what does "and/or not reassignable buffer" mean?
> >>
> [snip]
> --
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> http://lists.isocpp.org/mailman/listinfo.cgi/std-discussion

Oh sorry, I thought it was clear. It's not an official term AFAIK. It just means that you can't reassign the variable, since you can't assign an array to another array. Basically you can't assign it another value (deleting the assignment operator would also make a type not reassignable). In this case, the new object is accessible through the result of placement new, but if you use a C style array as buffer, then you can't assign the result to that array.

Hope that makes sense :) sorry

-- 
- Nicolas

Received on 2019-04-29 10:40:39