這可以在GCC 4.6上編譯,但不適用於VS2010 sp1:
是我的錯還是VS搞砸了?
#include "stdafx.h"
enum Attribute{red_att,black_att,key_att,value_att};
struct Color{};
template
struct Tag_Value;
template<>
struct Tag_Value
{
typedef Color type;
};
int main()
{
return 0;
}
Errors:
error C2599: 'Attribute' : forward declaration of enum type
is not allowed
錯誤C2440:'specialization':無法從'Attribute'轉換為'Attribute'