From 79291d04ca5a67f0b8065280231cb409f6196d9a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 9 Sep 2019 20:21:49 +0200 Subject: [PATCH] Make element acess in gnss_circular_deque const --- src/algorithms/libs/gnss_circular_deque.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/libs/gnss_circular_deque.h b/src/algorithms/libs/gnss_circular_deque.h index 17ad3b9ef..b66cca50a 100644 --- a/src/algorithms/libs/gnss_circular_deque.h +++ b/src/algorithms/libs/gnss_circular_deque.h @@ -45,7 +45,7 @@ public: Gnss_circular_deque(const unsigned int max_size, const unsigned int nchann); //!< nchann = number of channels; max_size = channel capacity unsigned int size(const unsigned int ch); //!< Returns the number of available elements in a channel T& at(const unsigned int ch, const unsigned int pos); //!< Returns a reference to an element with bount checking - T& get(const unsigned int ch, const unsigned int pos); //!< Returns a reference to an element without bound checking + const T& get(const unsigned int ch, const unsigned int pos) const; //!< Returns a reference to an element without bound checking T& front(const unsigned int ch); //!< Returns a reference to the first element in the deque T& back(const unsigned int ch); //!< Returns a reference to the last element in the deque void push_back(const unsigned int ch, const T& new_data); //!< Inserts an element at the end of the deque @@ -102,7 +102,7 @@ T& Gnss_circular_deque::at(const unsigned int ch, const unsigned int pos) template -T& Gnss_circular_deque::get(const unsigned int ch, const unsigned int pos) +const T& Gnss_circular_deque::get(const unsigned int ch, const unsigned int pos) const { return d_data[ch][pos]; }