diff options
author | lloyd <[email protected]> | 2010-10-18 18:59:03 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-18 18:59:03 +0000 |
commit | de943fee887bf594583753fe0c42e44527278bb1 (patch) | |
tree | 6c4075c72f1ca3eb02907acc7e5deae2ff52a2db | |
parent | 8aceb41ff4938e52d07a69235c25c3f67d016413 (diff) |
For const BigInt::operator[], return a const reference instead of a
value, so you can always safely capture the result by a const
reference.
-rw-r--r-- | src/math/bigint/bigint.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/math/bigint/bigint.h b/src/math/bigint/bigint.h index 3fee70899..0fd9b05cb 100644 --- a/src/math/bigint/bigint.h +++ b/src/math/bigint/bigint.h @@ -135,7 +135,7 @@ class BOTAN_DLL BigInt * @param i a word index * @return the word at index i */ - word operator[](size_t i) const { return reg[i]; } + const word& operator[](size_t i) const { return reg[i]; } /** * Zeroize the BigInt |