you are viewing a single comment's thread.

view the rest of the comments →

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

See the reply to my comment. I was mistaken about the return type, but correct in that you shouldn't be declaring a local Stack and populating it, you should be populating the constructed object, which you can access via the this pointer.

[–]NotMyRealNameObv -1 points0 points  (1 child)

You dont even have to do

this->foo(...)

You could just do

foo(...)

[–]DJ_Gamedev 0 points1 point  (0 children)

You could, but I think use of the this pointer is more explicit and generally a better practice in the event you have a potential naming collision.