You really don't have enough appreciation for Option::map until you try to do the same thing in C++ (while keeping everything on the stack)
Forgive me if this is stupid, but is there a reason you can't use `std::optional<&Bar>` here?
-
-
Yeah, sadly I can't use the STL pretty much at all.https://twitter.com/Sunjay03/status/1199458708553715712?s=20 …
-
At that point aren't you pretty much writing C with more confusing rules about the .ctors section?
- 10 more replies
New conversation -
-
-
two reasons 1) &Bar is not how references are written in C++ :v 2) std::optional<T&> doesn't exist because some people on the committee are VERY MAD about "rebinding references", despite us already having types in C++ that do this.
-
I could do optional<Bar> or something but I have no optional type so I'm stuck with pointers.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

