▲ 350 ▼ I love new features (lemmy.zip) submitted 2 years ago by Maven@lemmy.zip to c/programmer_humor@programming.dev 43 comments fedilink hide all child comments
[–] gratux@lemmy.blahaj.zone 46 points 2 years ago (1 child) many reasons, for example multidimensional arrays arrays of function pointers pass by reference of a pointer permalink fedilink source parent hideshow 2 child comments replies: [–] xmunk@sh.itjust.works 6 points 2 years ago* (1 child) In two of your cases this operator is pretty shit because at some point you'll probably want to offset the access (this isn't a knock at you but at the feature). This operator would only really be relevant to the last case which rarely comes up outside of infrastructure/library work (building a tool building tool) and usually those code bases are cautious to adopt new features too quickly anyways for portability. I've done serious C++ work (not much in the past decade though) - while references are absolutely amazing and you essentially want to pass by const ref by default I think well written maintainable C++ should maybe have a dozen heap objects tops. C++ is a better language if you generally forget that pointers and bare arrays exist. Just again - I think you're right and the fact that your list is only three things long (and arguably two of them would be misuses) is a pretty clear sign that this is an incredibly niche feature. permalink fedilink source parent hideshow 2 child comments replies: [–] sukhmel@programming.dev 17 points 2 years ago* (1 child) I don't think this operator is a real feature, tbh 😅 permalink fedilink source parent hideshow 2 child comments replies: [–] marcos@lemmy.world 6 points 2 years ago The fact that he claims it's in C++ 29, while we are in 2024 is a good hint. Or maybe he is a time traveler. Quick, go ask the next lottery numbers! permalink fedilink source parent
[–] xmunk@sh.itjust.works 6 points 2 years ago* (1 child) In two of your cases this operator is pretty shit because at some point you'll probably want to offset the access (this isn't a knock at you but at the feature). This operator would only really be relevant to the last case which rarely comes up outside of infrastructure/library work (building a tool building tool) and usually those code bases are cautious to adopt new features too quickly anyways for portability. I've done serious C++ work (not much in the past decade though) - while references are absolutely amazing and you essentially want to pass by const ref by default I think well written maintainable C++ should maybe have a dozen heap objects tops. C++ is a better language if you generally forget that pointers and bare arrays exist. Just again - I think you're right and the fact that your list is only three things long (and arguably two of them would be misuses) is a pretty clear sign that this is an incredibly niche feature. permalink fedilink source parent hideshow 2 child comments replies: [–] sukhmel@programming.dev 17 points 2 years ago* (1 child) I don't think this operator is a real feature, tbh 😅 permalink fedilink source parent hideshow 2 child comments replies: [–] marcos@lemmy.world 6 points 2 years ago The fact that he claims it's in C++ 29, while we are in 2024 is a good hint. Or maybe he is a time traveler. Quick, go ask the next lottery numbers! permalink fedilink source parent
[–] sukhmel@programming.dev 17 points 2 years ago* (1 child) I don't think this operator is a real feature, tbh 😅 permalink fedilink source parent hideshow 2 child comments replies: [–] marcos@lemmy.world 6 points 2 years ago The fact that he claims it's in C++ 29, while we are in 2024 is a good hint. Or maybe he is a time traveler. Quick, go ask the next lottery numbers! permalink fedilink source parent
[–] marcos@lemmy.world 6 points 2 years ago The fact that he claims it's in C++ 29, while we are in 2024 is a good hint. Or maybe he is a time traveler. Quick, go ask the next lottery numbers! permalink fedilink source parent