Why do inline functions have external linkage by default?

前端 未结 2 670
执笔经年
执笔经年 2020-12-30 02:30

The standard says that given a declaration of

inline void foo();

that foo is an inline function with external linkage (becaus

2条回答
  •  遥遥无期
    2020-12-30 02:58

    This is aptly answered here by Jonathan Schilling's article: Extern Inlines By Default.

    To quote him about motivation for this change:

    The immediate motivation for this change was a need of the new template compilation model that was adopted at the same meeting; but more generally it was felt that changing the default was an idea whose time had come, and the change was approved unanimously in both ANSI and ISO.

提交回复
热议问题