← Back to context

Comment by alfanick

10 years ago

Usually I define new types, when I use them a lot like:

    class Something {
      typedef std::unique_ptr<Something> unique;
      typedef std::shared_ptr<Something> shared;
      typedef std::weak_ptr<Something> weak;
        
    };

    // ...
    // later in the code
    
    Something::unique a;
    // instead of std::unique_ptr<Something> a;

That's a neat way of handling it. I wouldn't have considered it. I think I'm gonna steal it.