dune-common
2.2.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dune
common
finitestack.hh
Go to the documentation of this file.
1
#ifndef DUNE_FINITE_STACK_HH
2
#define DUNE_FINITE_STACK_HH
3
8
#warning This file is deprecated and will be removed after the release of dune-common-2.2. \
9
Please use std::stack<Dune::ReservedVector> instead of FiniteStack.
10
11
#include <stack>
12
13
#include <
dune/common/exceptions.hh
>
14
#include <
dune/common/reservedvector.hh
>
15
16
namespace
Dune {
17
37
template
<
class
T,
int
n>
38
class
FiniteStack
39
:
public
std::stack<T, Dune::ReservedVector<T,n> >
40
{
41
public
:
42
44
bool
full
()
const
45
{
46
return
this->size()>=n;
47
}
48
52
T
pop
()
53
{
54
#ifndef NDEBUG
55
if
(this->empty())
56
DUNE_THROW
(
Dune::RangeError
,
"trying to call pop() on an empty FiniteStack"
);
57
#endif
58
T tmp = this->top();
59
this->std::stack<T,Dune::ReservedVector<T,n> >
::pop
();
60
return
tmp;
61
}
62
63
};
64
65
}
66
68
69
#endif
Generated on Mon Jun 4 2012 12:00:46 for dune-common by
1.8.1