什么是你的typedef'ing shared_ptr的约定? [英] What's your convention for typedef'ing shared_ptr?
本文介绍了什么是你的typedef'ing shared_ptr的约定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我命名约定typedef'ing了boost :: shared_ptr的模板之间的倒装假摔。例如:
I'm flip-flopping between naming conventions for typedef'ing the boost::shared_ptr template. For example:
typedef boost::shared_ptr<Foo> FooPtr;
解决一项公约之前,我想看看别人用什么。你的习惯是什么?
Before settling on a convention, I'd like to see what others use. What is your convention?
编辑:
对于那些内嵌套的富类型定义,不烦你,美孚现在是如何将其传递意识?这似乎打破封装。这个怎么样:
To those nesting the typedef inside Foo, doesn't it bother you that Foo is now "aware" of how it will be passed around? It seems to break encapsulation. How about this:
class Foo
{
public:
typedef std::vector<Foo> Vector
};
您现在就不会做到这一点,你会吗? : - )
You wouldn't do this now, would you? :-)
推荐答案
答:不这样做。它的方便,为您和其他人。说你是什么意思。
Answer: don't do it. It's convenient for you and nobody else. Say what you mean.
这篇关于什么是你的typedef'ing shared_ptr的约定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文