Ray's playground

 

Item 21: Don't try to return a reference when you must return an object(Effective C++)

Never return a pointer or reference to a local stack object, a reference to a heap-allocated object, or a pointer or reference to a local static object if there is a chance that more than one such object will be needed.

posted on 2011-03-27 10:45  Ray Z  阅读(218)  评论(0编辑  收藏  举报

导航