I wasn’t sure which word to use so wikipedia to the rescue https://en.wikipedia.org/wiki/Bracket
- 1 Post
- 7 Comments
You can overload the indexing operazor “[]” (std::vector does this for example), and since c++23 this operator can have more than one argument.
The last one is a constructor call with an overloaded conversion operator. The {} syntax is possible since c++11 I think. The conversion operator was already available before that
Good point regarding the {} implementation.
I disagree slightly regarding your point that these aren’t function calls. Yes technically they are different things but effectively they are functions, I cann pass arguments and get a result based on some operations.
Of course not all of these can do anything but only the constexpr value is actually pretty limited. The other ones are straight up functions
Kwdg@discuss.tchncs.deto
Selfhosted@lemmy.world•ISP won't set up static IP - Services keep going downEnglish
31·29 days agoI think the default solution for this is to use a dynamic dns. There are services for that or you can get yourself a domain and configure that as dnydns in your router. That is what I am doing atleast
Kwdg@discuss.tchncs.deto
Programming@programming.dev•What is your preferred import style
4·2 months agoIt’s actually pretty similar to rust, only that rust can import multiple modules (namespaces) in one line, which is just syntax sugar, and the syntax is slightly different.
Your example would be
use my_projext::domain::entities; use my_project::api::contracts::routes::http as routes;
Kwdg@discuss.tchncs.deto
History Memes@piefed.social•I just wanted to know how bad Lead really is and end up hereEnglish
14·3 months agoThat wasn’t the camera guy. It was Tom from “Explosion&Fire” / “Extraction&Ire” who is a pretty cool chemostry youtuber from australia. I think it was a bit or he had something different to do, because he does some pretty sketchy stuff on his own channel sometimes

I don’t really know myself, probably the many footguns and complexities. Like taking a reference to a value in a vector and then resizing the vector, boom undefined behaviour. There a re a lot of things like this. Maybe also the verbosity and multie ways to do things. Look at the linked code, there is a lot of overhead to the function definitions, sure there is a point to all of it and I put it there for a reason, but to people less familiar to the language it is probably quite offputting.
Personally I like the language, second only to rust for me