Multiple ChoiceIntermediate 45s
Template instantiation in TUs
If a class template is instantiated in two TUs with the same arguments, the linker:
Options
- 1It reports a duplicate-symbol error for the class, since two instantiations cannot coexist.
- 2It creates two distinct runtime types that share a name but cannot interoperate at runtime.
- 3Folds the identical instantiations together (vague linkage / COMDAT); identical definitions are required, else ODR UB.
- 4It instantiates the template only in whichever translation unit happens to #include it first.
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.