Date: Mon, 18 Aug 2025 14:58:15 +0200
On 18. Aug 2025, at 09:45, Jan Schultke <janschultke_at_[hidden]> wrote:
>
>> What does the comma in new-placement and new-initializer actually do?
>
> It separates the list of arguments, just like in a function call. For example:
>
> new (a,b,c,) T(x,y,z,)
>
The name "placement new" is a little misleading. There are other use cases of this if you overload the operator new(). In this case I do agree that it should be part of this list. Looks like this got me confused with new-initializer as well. Taking a second look it is certainly obvious. So, I have now full agreement with your list. Thanks for clarifying.
>
>> What does the comma in new-placement and new-initializer actually do?
>
> It separates the list of arguments, just like in a function call. For example:
>
> new (a,b,c,) T(x,y,z,)
>
The name "placement new" is a little misleading. There are other use cases of this if you overload the operator new(). In this case I do agree that it should be part of this list. Looks like this got me confused with new-initializer as well. Taking a second look it is certainly obvious. So, I have now full agreement with your list. Thanks for clarifying.
Received on 2025-08-18 12:58:18