C++11 Extern Template
If an inline function or variable (since c++17) with external linkage is defined differently in different translation units, the behavior is undefined. The inline specifier cannot be used with a function or variable (since c++17) declaration at block scope (inside another function). Only the declaration is required to be visible when explicitly instantiating a function template, a variable template, (since c++14) a member function or static data member of a class template, or a member function template. Clang's c++11 mode can be used with libc++ or with gcc's libstdc++. Explicit instantiation has no effect if an explicit specialization appeared before for the same set of template arguments.
C++11 Extern Template - The change to the standard lacks a corresponding change for. The inline specifier cannot be used with a function or variable (since c++17) declaration at block scope (inside another function). For information about c++11 support in a specific version of gcc, please see: Clang's c++11 mode can be used with libc++ or with gcc's libstdc++. Only the declaration is required to be visible when explicitly instantiating a function template, a variable template, (since c++14) a member function or static data member of a class template, or a member function template. If an inline function or variable (since c++17) with external linkage is defined differently in different translation units, the behavior is undefined. Explicit instantiation has no effect if an explicit specialization appeared before for the same set of template arguments.
C++11 Extern Template Gallery
The change to the standard lacks a corresponding change for. Only the declaration is required to be visible when explicitly instantiating a function template, a variable template, (since c++14) a member function or static data member of a class template, or a member function template. Explicit instantiation has no effect if an explicit specialization appeared before for the same set of template arguments. If an inline function or variable (since c++17) with external linkage is defined differently in different translation units, the behavior is undefined. Clang's c++11 mode can be used with libc++ or with gcc's libstdc++. The inline specifier cannot be used with a function or variable (since c++17) declaration at block scope (inside another function). For information about c++11 support in a specific version of gcc, please see:
Clang's C++11 Mode Can Be Used With Libc++ Or With Gcc's Libstdc++.
If an inline function or variable (since c++17) with external linkage is defined differently in different translation units, the behavior is undefined. For information about c++11 support in a specific version of gcc, please see: The change to the standard lacks a corresponding change for. Explicit instantiation has no effect if an explicit specialization appeared before for the same set of template arguments.