What's your convention for typedef'ing shared_ptr?

后端 未结 16 1701
北恋
北恋 2020-12-13 00:10

I\'m flip-flopping between naming conventions for typedef\'ing the boost::shared_ptr template. For example:

typedef boost::shared_ptr FooPtr;
         


        
16条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 00:23

    I'm not a big fan of Hungarian naming conventions, I usually use:

    typedef boost::shared_ptr FooSharedPtr;
    

    Detailed enough to be clear but short enough to not be a huge hassle. In any case, I would definitely indicate it's specifically a shared pointer, especially if you're not the only one who's going to be using that type in the future.

提交回复
热议问题