Container library without heap usage

S

sh

Hi,

knows someone a library for container classes like lists, maps, etc.
which is implemented without heap usage (no dynamic memory usage at
all). Example

class A {
Node node; // Required by List<T>
// Other class A stuff
};

List<A> list;
A a;

list.push(a);

Have a nice day!
 
V

Vladimir Jovic

sh said:
Hi,

knows someone a library for container classes like lists, maps, etc.
which is implemented without heap usage (no dynamic memory usage at
all). Example

What would it use instead?
 
S

sh

What would it use instead?

The classes likely have to provide some stuff required by the
particular container. The example indicates this with the Node member
of class A. In C you have something similar available via <sys/
queue.h> in FreeBSD for example.
 
V

Vladimir Jovic

sh said:
The classes likely have to provide some stuff required by the
particular container. The example indicates this with the Node member
of class A. In C you have something similar available via <sys/
queue.h> in FreeBSD for example.


You can take a look at stl port - it might have that option.
 
G

gpderetta

Hi,

knows someone a library for container classes like lists, maps, etc.
which is implemented without heap usage (no dynamic memory usage at
all). Example

class A {
  Node node; // Required by List<T>
  // Other class A stuff

};

List<A> list;
A a;

list.push(a);

Take a look at boost.intrusive.
 
J

Jorgen Grahn

The classes likely have to provide some stuff required by the
particular container. The example indicates this with the Node member
of class A. In C you have something similar available via <sys/
queue.h> in FreeBSD for example.

OK, but then it's not not a container class -- it doesn't really own
the things it "contains", nor manage their lifetimes.

Might be useful, but it's not a container.

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top