initializing containers

N

Neo

Hello,
If I have container objects(in my case queue) in my class as members do
I need to explicitly initialize them in the class constructor? If so
how do I initialize them?

thanks,
neo
 
D

David Harmon

On 2 Jan 2007 20:19:26 -0800 in comp.lang.c++, "Neo"
Hello,
If I have container objects(in my case queue) in my class as members do
I need to explicitly initialize them in the class constructor? If so
how do I initialize them?

If you want them initialized with the std::queue default constructor
then no more need be said. If you wish to invoke one of the other
std::queue constructors, then include that in the initializer list of
your class's constructor.
 

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
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top