News for hackers. Stuff that matters.
Re:C++ by Example by sudosysgen on Thursday September 22, 2022 @11:25AM (#32940208)
I don't see what special about double brackets? It's just calling the operator again on the result, completely intuitive.
Re:C++ by Example by edflsafoiewq on Thursday September 22, 2022 @11:39AM (#32940458)
He means attributes, eg [[nodiscard]]. Of course you shouldn't call them operators.
Re:C++ by Example by MauranKilom on Thursday September 22, 2022 @12:29PM (#32941225)
See, I assumed they meant the >> operator. That used to (long ago) be cause for grief in e.g. std::vector<std::vector<int>> where the parser would see a >> operator instead of two closing angle brackets (since fixed by changing the grammar).
Re:C++ by Example by tialaramex on Thursday September 22, 2022 @05:34PM (#32944910)
So, there are four things which might get colloquially called "Brackets", they each have other names but...

(Round) brackets are Parentheses

{Curly} brackets are Braces

<Angle> brackets are Chevrons

[Square] brackets are often just Brackets

Ah, so there's the problem. Now, this actually also differs depending on English variant. In England it would be pretty normal to say "Brackets" and mean Parentheses, whereas in the US you'd mean the square brackets. Some English speakers outside the US might call the Square Brackets "Crotchets" to distinguish them, not so many. US English dominates in technology.