diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-11-02 15:20:29 -0700 |
---|---|---|
committer | Brent Stapleton <bstapleton@g.hmc.edu> | 2018-11-13 10:42:27 -0800 |
commit | 1ab86305c15fe0ab080282e83b07e24ebb0f0bb7 (patch) | |
tree | 954453f50ac1b9a33bee667d69c852e5dee7b82d | |
parent | de4d0c0867efee1e81809ce0e4b6c8f7557c958e (diff) | |
download | uhd-1ab86305c15fe0ab080282e83b07e24ebb0f0bb7.tar.gz uhd-1ab86305c15fe0ab080282e83b07e24ebb0f0bb7.tar.bz2 uhd-1ab86305c15fe0ab080282e83b07e24ebb0f0bb7.zip |
coding guidelines: Add .at() vs [] comment
-rw-r--r-- | CODING.md | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |