From 59cc02588cad15882aed7701b7214d0843af9648 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 13 Nov 2016 16:47:04 +0000 Subject: [PATCH] Corrected const top() --- src/intrusive_stack.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/intrusive_stack.h b/src/intrusive_stack.h index d7c43c24..0fc0cb61 100644 --- a/src/intrusive_stack.h +++ b/src/intrusive_stack.h @@ -117,6 +117,15 @@ namespace etl return *static_cast(p_top); } + //************************************************************************* + /// Gets a const reference to the value at the top of the stack.
+ /// \return A const reference to the value at the top of the stack. + //************************************************************************* + const_reference top() const + { + return *static_cast(p_top); + } + //************************************************************************* /// Adds a value to the stack. ///\param value The value to push to the stack. @@ -148,15 +157,6 @@ namespace etl --current_size; } - //************************************************************************* - /// Gets a const reference to the value at the top of the stack.
- /// \return A const reference to the value at the top of the stack. - //************************************************************************* - const_reference top() const - { - return *p_top; - } - //************************************************************************* /// Clears the stack to the empty state. //*************************************************************************