What's your convention for typedef'ing shared_ptr?

后端 未结 16 1700
北恋
北恋 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:45

    My preference:

    class Foo
    {
    public:
    
        typedef boost::shared_ptr SharedPointer;
    };
    

    The problem with just FooPtr is that you may have different types of pointers (e.g., weak_ptrs). I also don't much care for abbreviations, but that's another matter altogether.

提交回复
热议问题