Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 3
    This: Queue(){ Queue(SOME_PREDEFINED_CONSTANT); is not doing what you think it is doing. Commented Mar 21, 2018 at 13:07
  • 3
    Queue() : Queue(SOME_PREDEFINED_CONSTANT) {} As written, your default constructor does not initialize any members. In its body, it creates and immediately discards a temporary Queue, which has zero effect. Commented Mar 21, 2018 at 13:07
  • Read about the rule of 0/3/5. Commented Mar 21, 2018 at 13:07
  • In addition to @Igor: Queue(int size = SOME_PREDEFINED_CONSTANT) achieves the same as "two in one". If Queue is constructed without argument, SOME_PREDEFINED_CONSTANT is used as default. Commented Mar 21, 2018 at 13:10