3 ms·
The point is apparently to return "type_t::num_types" if the key doesn't exist in the map. Using at() throws an exception if the key doesn't exist.
by charles-salvia 10y ago
The point is apparently to return "type_t::num_types" if the key doesn't exist in the map. Using at() throws an exception if the key doesn't exist.
- user5994461 10y agoThat's an artificial requirements, you can do the same with at() or change the requirements. Catching all errors to return a default type is an arguable decision.