Ray's playground

 

Source Files and Programs(Chapter 9 of The C++ Programming Language)

  In C and older C++ programs, the keyword static is (confusingly) used to mean ‘‘use internal linkage’’.

  Consequently, the rule in the standard that says that there must be a unique definition of a class, template, etc., is phrased in a somewhat more complicated and subtle manner. This rule is commonly referred to as ‘‘the one definition rule,’’ the ODR. That is, two definitions of a class, template, or inline function are accepted as examples of the same unique definition if and only if

  [1] they appear in different translation units, and

  [2] they are token-for-token identical, and

  [3] the meanings of those tokens are the same in both translation units. 

posted on 2010-07-28 09:03  Ray Z  阅读(230)  评论(0编辑  收藏  举报

导航