oop - Instantiating a queue as a class member in C++ -


Suppose that I need a square which is the priority queue of other objects (which means that the queue is a member of the class) And additionally it gives some extra work.

I am not sure what is the best way to define the vector and, primarily, how to instantiate it.

In the header file:

  // in SomeClass.h: Class SomeClass {public: SomeClass (); // Constructor // Other methods Private: std :: priority_queue & lt; Other class & gt; Queue; };  

While the source file is something like this:

  // SomeClass :: SomeClass () in SomeClass.cpp: For this, it is not necessary to call it explicitly {//} Other methods  


Edit: , Released the call according to Ray Gone.

<

  SomeClass :: SomeClass (): qi () {} 

C ++ knows that the controller has to call from there with no logic.


Comments