Return Optional value with ?: operator – stackoverflow.com

I often need to use optional type for functions: std::optional<int32_t> get(const std::string& field) { auto it = map.find(field); if (it != map.end()) return it->second; ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Return Optional value with ?: operator – stackoverflow.com"