Correctly forwarding the value category for a member of a compound type before C++23 was cumbersome. Forunately C++23 introduced the std::forward_like, which makes this operation a lot simpler. The std::forward_like is also essential when using the "deducing this" feature. Compiler Explorer link: https://lnkd.in/dS32w-6J #cpp #cplusplus #coding #programming #dailybiteofcpp
Hmm...why not using std::forward? Or it's a solution for functions ?
It's a follow up for deduced this. It was already mentioned in the original proposal for deduced this.
Not sure, but why can’t we just use: void extract4(auto&& wrapper) { fun(std::forward<decltype(wrapper)>(wrapper)); }