Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : GENQ3.H

 
Output of file : GENQ3.H contained in archive : CUJ0894.ZIP
Listing 1 - class definition for a generic queue using void * elements

//
// genq3.h - generic queue using void *
// elements and an iteration function
//

#include

class genq
{
public:
genq();
~genq();
void append(void *e);
void apply(void f(void *p));
void clear();
int remove(void *&e);
private:
struct cell
{
cell(void *e, cell *p);
cell *next;
void *element;
};
cell *first, *last;
};

inline genq::cell::cell(void *e, cell *p)
: element(e), next(p)
{
}

inline genq::genq() : first(0), last(0)
{
}

inline genq::~genq()
{
clear();
}


  3 Responses to “Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : GENQ3.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/