-
Notifications
You must be signed in to change notification settings - Fork 251
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
[BUG] _braced-init-list_ argument in Cpp2 #542
Comments
For example, I think it's preferable to replace Cppfront's Cpp1 source code parameter_declaration_list(false, false, true)
parameter_declaration_list(false, true) with parameter_declaration_list({.parameterized_statement = true})
parameter_declaration_list({.whatever_else = true}) respectively. |
Something that's been bothering me in Cpp2 is the overloading of parentheses. Instead of overloading that last meaning,
That could resolve #321, #449, and close #487. - tab = (3,2,1);
+ tab = :=(3,2,1);
- check((0, 0)); // BUG!
+ check(:=(0, 0));
- v = ();
+ v = :=(); #487 also mentions #408 and #451. -f: (forward x) -> forward _ = (forward x); // error: lowers to `return { CPP2_FORWARD(x) };`
+f: (forward x) -> forward _ = (forward x); // OK
+f: (forward x) -> forward _ = :=(forward x); // error: lowers to `return { CPP2_FORWARD(x) };`
-f: (forward x) -> forward _ = forward x; // error: missing parentheses
+f: (forward x) -> forward _ = forward x; // OK #451 is superficially resolved, but shouldn't be closed, because as quoted:
It might seem tempting to continue permitting |
Another point that's been bugging me
|
I tried this hack: #568 (comment).
|
I just missed being able to make an argument be non-deducible. template<class T> struct C {
T a;
T b;
};
auto x(auto a, auto b) { return C{a, {b}}; }
auto y(auto a, auto b) { return C<decltype(a)>{a, b}; }
C v0 = x(0LL, 0);
C v1 = y(0LL, 0); In my actual code base, this is the difference:
|
Related: #568 (comment), #678, #853. |
An alternative syntax is to use |
Title: braced-init-list argument in Cpp2.
Description:
#449 should be fixed by #487,
and here I extract a remaining issue:
-- #449 (comment) (extract)
I'm trying to convert the SFML's https://www.sfml-dev.org/documentation/2.6.0/#example:
to Cpp2, which in its
master
branch (SFML 3) looks like:Fortunately, I can name the type, so I translated it to:
But what if this Cpp1's API type wasn't possible to be named,
and required such Cpp1 syntax to be used:
sf::VideoMode({800, 600})
?The text was updated successfully, but these errors were encountered: