coding guidelines: Add .at() vs [] comment

This commit is contained in:
Martin Braun 2018-11-02 15:20:29 -07:00 committed by Brent Stapleton
parent de4d0c0867
commit 1ab86305c1

View File

@ -84,6 +84,11 @@ Date: Tue Nov 22 16:19:38 2016 -0800
Reviewed-By: Martin Braun <martin.braun@ettus.com>
```
* Prefer `.at()` over `[]` for maps and vectors. Keep in mind that `[]` will
invoke a default constructor of the value type, whereas `.at()` will throw
an exception if the index doesn't exist -- which is usually the desired
behaviour.
## Boost-specific Guidelines