-
-
Notifications
You must be signed in to change notification settings - Fork 646
Placement new doesn't count as 'initialisation' #21203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@WalterBright there's a few of these backing up... getting harder to make progress. |
I doubt this is trivial - a placement-new might not initialize the whole member, but just a portion of it. Think of a static array being initialized with multiple placement-new (or just partially with a single one). The first assignment to a member in a ctor is special, is always a construction (not an assignment). So I hope we don't really need ugly placement-new in ctors. |
I haven't looked at the logic for constructor initialization in 15+ years :-) For the moment, it can be worked around by simply initializing |
Yes, I know. Could that 'first assignment' logic be tickled also by being the argument to a placement new expression? Calling placement new on something should be equivalent to the init assignment. I guess the init assignment must just flag a bool; passing to a placement new could just flag the same bool? That's all that would be needed.
|
m
was initialised by explicit constructor call.The text was updated successfully, but these errors were encountered: