Lumiera  0.pre.03
»edit your freedom«
IterStack< TY > Struct Template Reference

#include "lib/iter-stack.hpp"

Description

template<class TY>
struct lib::IterStack< TY >

A Stack which can be popped by iterating.

This is a simple helper built by wrapping up STL's double ended queue (deque). Thus, each instance holds the full state, which is actually kept in heap allocated storage. Pushing of new elements and iterator use may be mixed.

Contrary to just using std::stack

  • the iteration is compliant to the Lumiera Forward Iterator concept
  • there is a simplified pop() function which removes and returns at once

Definition at line 122 of file iter-stack.hpp.

Public Member Functions

void clear ()
 
bool empty () const
 
IterStackinsert (TY const &elm)
 
TY pop ()
 
IterStackpush (TY const &elm)
 
IterStackpush (TY &&elm)
 
size_t size () const
 
- Public Member Functions inherited from IterStateWrapper< TY, iter::IterDequeStorage< TY > >
 IterStateWrapper (iter::IterDequeStorage< TY > &&initialState)
 
 IterStateWrapper (iter::IterDequeStorage< TY > const &initialState)
 
bool empty () const
 
 ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (IterStateWrapper)
 
bool isValid () const
 
 operator bool () const
 
reference operator* () const
 
IterStateWrapperoperator++ ()
 
pointer operator-> () const
 

Additional Inherited Members

- Public Types inherited from IterStateWrapper< TY, iter::IterDequeStorage< TY > >
typedef TY * pointer
 
typedef TY & reference
 
typedef TY value_type
 
- Protected Member Functions inherited from IterStateWrapper< TY, iter::IterDequeStorage< TY > >
void __throw_if_empty () const
 
iter::IterDequeStorage< TY > & stateCore ()
 allow derived classes to access state representation
 
iter::IterDequeStorage< TY > const & stateCore () const
 
+ Inheritance diagram for IterStack< TY >:
+ Collaboration diagram for IterStack< TY >:

The documentation for this struct was generated from the following file: