由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - still confused about inline
相关主题
A tech question (转载)弱问c++里有没有NULL这个keyword?
inline functions in C++C++ memcpy declaration use restrict keyword?
inline C function in VC++ 2005 expressintel released c++ compiler 2013
inline到底能省多少时间?C array
inline function是否可以递归?A C++ compiler related interview question
请教C++里面这个表达*** help needed! on MATLAB GUI ***
c++中的inline 函数是做什么的?[转载] What search method is used in exists()?
About volatile in CHow to tell gcc stop compiling.
相关话题的讨论汇总
话题: inline话题: keyword话题: exists话题: compiler话题: always
进入Programming版参与讨论
1 (共1页)
g*********s
发帖数: 1782
1
// this is a .h file
class X {
};
inline X::X()
{
cout << "X" << endl;
}
1) is "inline" keyword required or optional here?
2) will compiler always "inline" this function if "inline" keyword exists?
3) will compiler always skip "inline" this function if "inline" keyword
doesn't exists?
4) if 2) & 3) both "no", then why we need inline keyword?
t****t
发帖数: 6806
2
1. if multiple source will include this .h, then inline is required.
otherwise it's multiple definition. inline members can be multiple defined,
even if it is not always inlined.
2. no
3. no
4. see answer to 1.

【在 g*********s 的大作中提到】
: // this is a .h file
: class X {
: };
: inline X::X()
: {
: cout << "X" << endl;
: }
: 1) is "inline" keyword required or optional here?
: 2) will compiler always "inline" this function if "inline" keyword exists?
: 3) will compiler always skip "inline" this function if "inline" keyword

1 (共1页)
进入Programming版参与讨论
相关主题
How to tell gcc stop compiling.inline function是否可以递归?
inheritence problem请教C++里面这个表达
An interesting C++ compile errorc++中的inline 函数是做什么的?
谁来解释一下这个是compiler问题吗?About volatile in C
A tech question (转载)弱问c++里有没有NULL这个keyword?
inline functions in C++C++ memcpy declaration use restrict keyword?
inline C function in VC++ 2005 expressintel released c++ compiler 2013
inline到底能省多少时间?C array
相关话题的讨论汇总
话题: inline话题: keyword话题: exists话题: compiler话题: always