Multiple ChoiceBeginner 45s
std::optional value semantics on engagement
Which expression safely checks whether a std::optional<int> o holds a value?
Options
- 1if (o.has_value())
- 2if (o == nullptr)
- 3if (o.value_or(0))
- 4if (o.data() != nullptr)
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.