home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 May
/
Pcwk5b98.iso
/
Borland
/
Cplus45
/
BC45
/
CLOBSS.PAK
/
STACK.CPO
< prev
next >
Wrap
Text File
|
1995-08-29
|
1KB
|
34 lines
/*------------------------------------------------------------------------*/
/* */
/* STACK.CPP */
/* */
/* Copyright Borland International 1991, 1993 */
/* All Rights Reserved */
/* */
/*------------------------------------------------------------------------*/
#if !defined( __STACK_H )
#include "classlib\obsolete\stack.h"
#endif // __STACK_H
void Stack::push( Object& toPush )
{
list.add( toPush );
itemsInContainer++;
}
Object& Stack::pop()
{
Object& temp = list.peekHead();
list.detach( temp );
if( temp != NOOBJECT )
itemsInContainer--;
return temp;
}
ContainerIterator& Stack::initIterator() const
{
return *( (ContainerIterator *)new ListIterator( list ) );
}