Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Ahnfelt

  1. Ahnfelt

    The safety of returning a new pointer as a reference: MyClass& () { re

    Thanks for the quick response :) I figured it would happen as there was an uneven number of contructions and destructions (see the output: comment), but I had to make sure. I will return a pointer as usual instead :)
  2. Ahnfelt

    The safety of returning a new pointer as a reference: MyClass& () { re

    My question is simply, will this lead to memory leaks with any otherwise perfect class) or does the compiler know when the newly created variable (created with new but returned as a reference (not a pointer)) will go out of scope? Thanks a lot - Joakim. #include <iostream> class Foo { public...

Part and Inventory Search

Back
Top