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. //*************************************************************************