3 ms·
std::optional is not limited to pointers, and it has the safety if you want it - use value().
by kllrnohj 4y ago
std::optional is not limited to pointers, and it has the safety if you want it - use value().
- electroly 4y agoThere are some platforms that provide std::optional but not value()! macOS 10.13 is one of them. You're forced to use the unsafe * operator on that platform. I cannot imagine the rationale that went into shipping std::optional support without value(), but they did it.