aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-18 18:59:03 +0000
committerlloyd <[email protected]>2010-10-18 18:59:03 +0000
commitde943fee887bf594583753fe0c42e44527278bb1 (patch)
tree6c4075c72f1ca3eb02907acc7e5deae2ff52a2db
parent8aceb41ff4938e52d07a69235c25c3f67d016413 (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.h2
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