C++23 explicit object parameter (a.k.a. deducing this) introduces the ability to name the previously implicit "this" argument explicitly. This allows for different spellings of method variants (lvalue, const lvalue, rvalue). Combined with type deduction, it finally allows spelling all three variants as one generic method (significantly reducing code duplication). Compiler Explorer link: https://lnkd.in/einiTRQw #cpp #cplusplus #coding #programming #dailybiteofcpp
Such a great smal feature with huge impact, love it :) but so far only available for msvc right? Though clang 18 wanted to introduce it as well afaik...
These regular little nuggets are golden. It's very easy in C++ to simply not be aware that there's a prepackaged solution to some problem you're encountering. For example: std::address_of, or std::forward_like. C++ is loaded with these. These posts help, if nothing else, to trigger a lightbulb of 'I think I've seen this somewhere' and off you go to find and use it, instead of trying to solve the thing yourself. In this case, it would be writing 3 or 6 functions (that the compiler can comfortably do for you). Thanks for the posts, love it!
#lol using #puts a C library function and calling it #C++23 😀 😁 😂 🤣 I won't even call it #C++99 #WTF happened to #print function in C++ 23?
Looks like soon we may have duck typing concept in C++
I love (this auto&& self) 👌
Doble Engineering•1K followers
2yWhich IDE are your screenshots from?