Answer
The One Definition Rule controls how many definitions of entities may appear in a C++ program. • A definable item generally has at most one definition in a translation unit. • Some entities such as inline functions and templates may have equivalent definitions in multiple translation units. • Violating an ODR rule can make a program ill-formed, sometimes with no diagnostic required.
💡 C++ Example
// math.hpp
inline int square(int value) {
return value * value;
}
⚡ Quick Revision
The ODR governs legal definitions across translation units.