-
Notifications
You must be signed in to change notification settings - Fork 269
v0.7.1 #1155
-
What's Changed: Highlights
- Add
..syntax to invoke only a member function (no UFCS), e.g.,mystring..append("foo") - Allow
x: const = init;andx: * = init;without_type wildcard - Allow concatenated string literals, e.g.,
"Hello " "(name$)\n" - Faster compile time when doing heavy reflection and code generation
- Ensure definite first use initialization cannot happen inside loops
- Better diagnostics for illegal UFCS calls
- Move-from-last-use only for moveable types
- Remove whitespace sensitivity for
*and& - Allow extra trailing commas in more places (
assert) - Support latest GCC and Clang
- Added
-quiet - Added
-cwd
New Contributors: Thanks again, and welcome!
- @dutkalex made their first contribution in Create CITATION.cff #1044
- @matgla made their first contribution in Fixes for arm-none-eabi-g++ #1045
- @alvarogalloc made their first contribution in docs: fix typo #1081
- @sookach made their first contribution in prohibit semicolons in parameter list #1100
- @helmesjo made their first contribution in feat: Add command
-cwd(change working directory) #1024
Full Changelog: v0.7.0...v0.7.1
This discussion was created from the release v0.7.1.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 4 -
🎉 13 -
🚀 2
Replies: 2 comments 2 replies
-
Congrats for the release! Hope we get to see UFCS in C++ as well someday!
Does cppfront use the -> syntax for members of pointers (as in foo->bar(baz))? If not, I think it would be better if the language used -> instead of .. for member-only calls. Confusion is obviously a problem, but I believe it's trivial since the compiler can provide a diagnostic of the form:
Member function `bar` not found. Did you mean to call the UFCS function `bar`: `foo.bar(baz)`?
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks!
Cpp2 does not have -> because dereference is suffix, so *. is the equivalent. I currently have a special diagnostic check for -> to direct folks to *.... the message is error: '->' is not Cpp2 deference syntax - write '*.' instead. Currently -> is used exclusively for return types and I'd like to stick with that so that as much as possible one syntax has one meaning in the language. I chose .. because it's similar to . but I'm open to revisiting that if there's a usability reason to in the future... probably the biggest one would be ranges, if I wanted that syntax for something like 1..10 or first..last, but I think ... will work fine there as ... is already expressing a (variadic) series of things.
Beta Was this translation helpful? Give feedback.
All reactions
-
Makes sense.
My reasons for using -> were purely because it feels more natural (to me foo-> reads exactly as "access something declared within foo") compared to .. (which like you mentioned, makes me think of ranges). Having a second thought about this, something like foo!.bar(args..) seems readable and also align with cppfront's idea of having postfix unary operators (always given that postfix !/!. is not used anywhere else).
Beta Was this translation helpful? Give feedback.
All reactions
-
Hurray. 🎉🎉🎉
Beta Was this translation helpful? Give feedback.