You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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: