具有显式模板实例化的extern关键字

Rec*_*ker 5 c++ c++11 visual-studio-2015

考虑我的问题的一个小的精简用例,其中我有一个标题如下

#include <iostream>
#pragma once
#ifndef HEADER_H
#define HEADER_H
template<typename T>
class FOO
{
public:
    void func() { std::cout << "Foo!"; };
};

extern template class __declspec(dllexport) FOO<int>;
using myfoo = FOO<int>;
#endif
Run Code Online (Sandbox Code Playgroud)

和一个源文件为

#include "Header.h"

int main()
{
    myfoo f;
    f.func();
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

当我使用VS 2015(更新3)进行编译时,出现以下警告

warning C4910: 'FOO<int>': '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
Run Code Online (Sandbox Code Playgroud)

MSDN page does not explain to me clearly why is it wrong to have extern and dllexport in explicit template declaration.

Can anybody please explain what is the rationale behind this ?