From de943fee887bf594583753fe0c42e44527278bb1 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 18 Oct 2010 18:59:03 +0000 Subject: For const BigInt::operator[], return a const reference instead of a value, so you can always safely capture the result by a const reference. --- src/math/bigint/bigint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/math/bigint') 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 -- cgit v1.2.3