Template Class enum_stack#

Inheritance Relationships#

Base Type#

  • public std::stack< TEnum >

Class Documentation#

template<typename TEnum, TEnum TDefault>
class enum_stack : public std::stack<TEnum>#

Safe stack implementation for an enum returning a default value when the stack is empty.

Public Functions

inline void pop()#

Pop the top-most entry from the stack if the stack is not empty.

inline TEnum top() const#

Return the value of the top-most entry of the stack or if empty a default value.

Returns:

The top-most or default value.