Skip to content

Commit 4f4a9c7

Browse files
Add at method to template_numberingt
Previously the only way of getting a value was with operator[], which makes it too easy to get a non-const reference without meaning to. This also removes an incompatibility with the previous version of numbering which was causing a diff between security analyser and CBMC.
1 parent d9cc0c0 commit 4f4a9c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/util/numbering.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ class template_numberingt final
6969
return data_.size();
7070
}
7171

72+
const key_type &at(size_type t) const
73+
{
74+
return data_.at(t);
75+
}
76+
7277
key_type &operator[](size_type t)
7378
{
7479
return data_[t];

0 commit comments

Comments
 (0)