Chinaunix首页 | 论坛 | 博客
  • 博客访问: 271455
  • 博文数量: 55
  • 博客积分: 2030
  • 博客等级: 大尉
  • 技术积分: 737
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-13 18:06
文章分类

全部博文(55)

文章存档

2011年(2)

2010年(7)

2009年(17)

2008年(29)

我的朋友

分类: C/C++

2008-09-05 15:53:13

Bear in mind that inline is a request to compilers, not a command. The request can be given implicitly or explicitly. The implicit way is to define a function inside a class definition:
 

class Person {

public:

  ...

  int age() const { return theAge; } // an implicit inline request: age is


  ... // defined in a class definition




private:

  int theAge;

};

friend functions can also be defined inside classes. When they are, they're also implicitly declared inline.

both inline functions and templates are typically defined in header files,Inlining in most C++ programs is a compile-time activity

If an exception is thrown during construction of an object, any parts of the object that have already been fully constructed are automatically destroyed.

阅读(757) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~