Linking problem for inline function
(June 30, 2006)
Sometimes, we find a linking problem with inline functions. The problem happens because code generator do not expand the inline functions in descendant classes. To solve the problem, we have to make the inline function virtual. Then, there will be an implicit declaration and expansion for the virtual inline functions in every descedant class. It is worth noting that this compiler behavior may belong to Visual C++ only. Other compilers, such as gcc, may not have this problem.
(June 30, 2006)
Sometimes, we find a linking problem with inline functions. The problem happens because code generator do not expand the inline functions in descendant classes. To solve the problem, we have to make the inline function virtual. Then, there will be an implicit declaration and expansion for the virtual inline functions in every descedant class. It is worth noting that this compiler behavior may belong to Visual C++ only. Other compilers, such as gcc, may not have this problem.
0 Comments:
Post a Comment
<< Home