What exactly is One Definition Rule in C++?
问题 What exactly does One Definition Rule in C++ say? The only trustworthy occurence I can find is in The C++ Programming Language, 3rd. ed., P. 9.2.3 . Is there any official definition of the rule except that? 回答1: The truth is in the standard (3.2 One definition rule) : No translation unit shall contain more than one definition of any variable, function, class type, enumeration type or template. [...] Every program shall contain exactly one definition of every non-inline function or object that