From 4f4a9c7e17fc7d0973a647d1594572689ca97576 Mon Sep 17 00:00:00 2001 From: Nathan Phillips Date: Tue, 2 Jan 2018 16:54:18 +0000 Subject: [PATCH] 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. --- src/util/numbering.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/numbering.h b/src/util/numbering.h index 124d7b4d084..f932874695a 100644 --- a/src/util/numbering.h +++ b/src/util/numbering.h @@ -69,6 +69,11 @@ class template_numberingt final return data_.size(); } + const key_type &at(size_type t) const + { + return data_.at(t); + } + key_type &operator[](size_type t) { return data_[t];