I understand intilializer lists mostly but am wondering if you can call a function in them. the following code initialized two nodes, but then calls the initqueue function in the body.
Does calling a function in the body still create two instances of the class when it is constructed? I started using init lists because I read of their advantages.
this code calls the function but I get the error
c:\visual studio 2010\c++\0 - good projects\queue\linkqueue.h(121): error C2436: 'initqueue' : member function or nested class in constructor initializer list
1>
The only purpose of the initializer list is to be able to call constructors other than the default one for class members or the base class. What do you hope to accomplish with that anyway?
Does calling a function in the body still create two instances of the class when it is constructed?
Eh? Only one instance is being constructed per constructor call, whether you call functions or not inside the constructor.