Special case: optional<bool> and optional<T*>
Explore how std::optional behaves with bool and pointer types in C++17, uncover potential ambiguities with tri-state booleans and nullable pointers, and understand best practices for safer code.
We'll cover the following...
We'll cover the following...
While you can use optional on any type, you need to pay attention when trying to wrap boolean or pointers.
optional<bool> - what does it model? With such a construction, you have a tri-state ...