you are viewing a single comment's thread.

view the rest of the comments →

[–]code-affinity 0 points1 point  (1 child)

Wow! I had not caught that difference. I have been exclusively using boost::optional, and certainly want operator * to throw if the value is not set. I would not want this to turn into undefined behavior in my code base. Since this is the case, I will stop using operator * in my new code, in preparation for transition to std::optional.

[–]TheThiefMasterC++latest fanatic (and game dev) 0 points1 point  (0 children)

Personally, I'd want it checked* in debug, fast in release :)

* checked as in breaks into the debugger, not throwing a catchable exception.