TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24434 19
Where is std::optional<T&&>???

10 years ago we've got std::optional<T>. Nice. But no std::optional<T&>... Finally, we are getting std::optional<T&> now (see beman project implementation) but NO std::optional<T&&>...

DO we really need another 10 years to figure out how std::optional<T&&> should work? Is it yet another super-debatable topic? This is ridiculous. You just cannot deliver features with this pace nowadays...

Why not just make std::optional<T&&> just like std::optional<T&> (keep rebind behavior, which is OBVIOUSLY is the only sane approach, why did we spent 10 years on that?) but it returns T&& while you're dereferencing it?

https://redd.it/1pfk0ox
@r_cpp
GitHub GitHub - bemanproject/optional: std::optional extensions adopted for C++26 std::optional extensions adopted for C++26. Contribute to bemanproject/optional development by creating an account on GitHub.
More from @r_cpp
  1. Oct 11, 2026VKRT NES Remaster — an open-source C++20 NES emulator with an observation-driven remasteri…
  2. Oct 11, 2026Right way to test async code https://redd.it/1x2wqgz @r_cpp
  3. Oct 10, 2026Yantra: an LALR(1) parser generator for C++23 Yantra: an LALR(1) parser generator for C++2…
  4. Oct 10, 2026Opting in, and back out again https://dryperspective.github.io/posts/opting-in/ https://re…
  5. Oct 10, 2026I’m Building Bursztyn OS a Polish Operating System From Scratch I’m building Bursztyn OS,…
  6. Oct 9, 2026std::variant, operator== and pattern matching I was thinking, wouldn't adding equality com…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →