C/C++
cpptmp.asc
Associated article: C++ Templates
Tags: C/C++
_C++ TEMPLATES_
by Pete Becker
Example 1:
class IntStack
{
public:
IntStack() : Current(Data) {}
int ItemsInStack() const
{
return Current - Data;
}
int Top() const
{
assert( ItemsInStack() != 0 );
return *Current;
}
void Push( int i )
{
assert( ItemsInStack() < Size );
*Current++ = i;
}
int Pop()
{
assert( ItemsInStack() != 0 );
...


