-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Changing the way how default construction is visualized #406
Comments
Hello @venkat-gvk, thanks for reporting this. There is already an issue open (#120) that addresses the same issue. Your suggestion seems to be an approach. The downside is that it requires filtering the initializer. What we all currently see is what is in the AST. To make work what you describe I need to filter out the call to the constructor. I have a prototype that does this, but I'm reluctant about how stable it is and what specialties I missed. Andreas |
Thanks for the Reply. Looking forward to the prototype |
While this fix addresses the original issue, the construction of an array as shown is invalid. This could be something resolved by #406.
Here is the code:
The output it produces:
The expression
Vector<Box> s = Vector<Box>{Box("one")};
looks like a temporary of Vector of Box is created and it is move initialized. Yes starting from C++17 onwards it is elided. But it looks like copy/move.If we change the output to something like
Vector<Box> s { Box("one") }
instead, it will match the default construction. If the class has an initializer_list constructor, the syntax would choose that. It will help distinguish copy/move and default initialization.Thanks.
The text was updated successfully, but these errors were encountered: