随笔 - 119  文章 - 290  trackbacks - 0

博客搬家了哦,请移步
叫我abc

常用链接

留言簿(12)

随笔分类

我的博客

搜索

  •  

积分与排名

  • 积分 - 300689
  • 排名 - 84

最新评论

阅读排行榜

凡是绝对有效对象或者需要有效对象的地方,使用引用
            void DoJob( CSceneMgr& );
            CSceneMgr& GetSceneMgr();
凡是允许或者无法判断对象是否有效的地方,使用指针,并在使用该指针的作用域内对指针进行判断。
            void DoJob( CSceneMgr* );
            CSceneMgr* GetSceneMgr();
posted on 2007-10-12 19:26 LOGOS 阅读(1372) 评论(2)  编辑 收藏 引用

FeedBack:
# re: 两个凡是 2007-10-13 14:22 Minidx全文检索
描述不是很确切啊  回复  更多评论
  
# re: 两个凡是 2007-10-14 19:41 abc
JSF-AV-Rules

AV Rule 117
Arguments should be passed by reference if NULL values are not possible:

AV Rule 117.1 An object should be passed as const T& if the function should not change the value of the object.

AV Rule 117.2 An object should be passed as T& if the function may change the value of the object.

Rationale: Since references cannot be NULL, checks for NULL values will be eliminated from the code. Furthermore, references offer a more convenient notation than pointers.

AV Rule 118
Arguments should be passed via pointers if NULL values are possible:

AV Rule 118.1 An object should be passed as const T* if its value should not be modified.

AV Rule 118.2 An object should be passed as T* if its value may be modified.

Rationale: References cannot be NULL.  回复  更多评论
  

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理