1 /* Stack - a template stack class
3 * Copyright 2001-2005, Axel Dörfler, axeld@pinc-software.de.
4 * This file may be used under the terms of the MIT License.
12 #include <SupportDefs.h>
15 template<class T
> class Stack
{
37 // could also free the memory
41 status_t
Push(T value
)
45 T
*newArray
= (T
*)realloc(fArray
, fMax
* sizeof(T
));
51 fArray
[fUsed
++] = value
;
60 *value
= fArray
[--fUsed
];