Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
Loading...
Searching...
No Matches
stack.hpp File Reference

This class specifies the basic operation on a stack as a linked list. More...

#include <iostream>
#include <memory>
#include <stdexcept>
#include <vector>
Include dependency graph for stack.hpp:

Go to the source code of this file.

Classes

class  node< Kind >
 for std::vector More...
 
class  stack< ValueType >
 

Functions

template<typename Node , typename Action >
void traverse (const Node *const inNode, const Action &action)
 

Detailed Description

This class specifies the basic operation on a stack as a linked list.

Author
danghai
Piotr Idzik

Function Documentation

◆ traverse()

template<typename Node , typename Action >
void traverse ( const Node *const  inNode,
const Action &  action 
)
26 {
27 if (inNode) {
28 action(*inNode);
29 traverse(inNode->next.get(), action);
30 }
31}