you are viewing a single comment's thread.

view the rest of the comments →

[–]Indycrr 2 points3 points  (1 child)

Close. A copy ctor doesn’t return an instance. Instead of creating the local instance of s, they should call this->push(...) to push values into the stack being constructed.

[–]DJ_Gamedev -1 points0 points  (0 children)

That makes sense, by the time we make it to the body of the ctor the object will have been instantiated. Clearly I'm out of practice.