From: Tomek Mrugalski Date: Thu, 22 Dec 2016 18:35:04 +0000 (+0100) Subject: [5039] getNonConst method is now const. X-Git-Tag: trac5021_base~3^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a536d9ce45154ab4de4afbdeefb8faac5d382178;p=thirdparty%2Fkea.git [5039] getNonConst method is now const. --- diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc index fde27e7571..260a08dc76 100644 --- a/src/lib/cc/data.cc +++ b/src/lib/cc/data.cc @@ -131,7 +131,7 @@ Element::get(const int) const { } ElementPtr -Element::getNonConst(const int) { +Element::getNonConst(const int) const { throwTypeError("get(int) called on a non-list Element"); } diff --git a/src/lib/cc/data.h b/src/lib/cc/data.h index 41c6ee3013..22c9a999e6 100644 --- a/src/lib/cc/data.h +++ b/src/lib/cc/data.h @@ -281,7 +281,7 @@ public: /// /// \param i The position of the ElementPtr to retrieve /// \return specified element pointer - virtual ElementPtr getNonConst(const int i); + virtual ElementPtr getNonConst(const int i) const; /// Sets the ElementPtr at the given index. If the index is out /// of bounds, this function throws an std::out_of_range exception. @@ -633,7 +633,7 @@ public: } using Element::get; ConstElementPtr get(int i) const { return (l.at(i)); } - ElementPtr getNonConst(int i) { return (l.at(i)); } + ElementPtr getNonConst(int i) const { return (l.at(i)); } using Element::set; void set(size_t i, ElementPtr e) { l.at(i) = e;