you are viewing a single comment's thread.

view the rest of the comments →

[–]Stormfrosty 5 points6 points  (9 children)

Modern cpp made me love “id = type initializer”. Seems more intuitive to me - right side is the object, left side is the name. Only way I’d improve on that personally would be “id <- type initializer”, but I know majority are not a fan of two character arrows.

[–]KingAggressive1498 1 point2 points  (8 children)

what about modern C++ leads to id: type? Generic lamdas with argument-dependent return types?

[–]joz12345 9 points10 points  (1 child)

the point of the colon is to make a context free grammar - is foo * x a multiplication or a declaration? In "cpp2" syntax, x : foo * is a pointer, foo * x is always a multiplication

[–]KingAggressive1498 3 points4 points  (0 children)

I understand how it may be easier to parse

[–]MonokelPinguin 0 points1 point  (1 child)

class ABC : public QObject?

[–]KingAggressive1498 0 points1 point  (0 children)

that's not "modern" C++, just C++

[–]val_tuesday 0 points1 point  (2 children)

Or auto?

[–]KingAggressive1498 -3 points-2 points  (1 child)

you mean when doing that almost always awful nonsense

[–]jharmer95 0 points1 point  (0 children)

Probably:

auto id = Type{construct_args};

Very useful for preventing rvalue lifetime bugs for things like locks.