I have a class foo with an enum template parameter and for some reason it links to two versions of the ctor in the cpp file.
enum Enum
{
bar,
baz
};
template <Enum version = bar>
class foo
{
public:
foo();
};
// CPP File
#include "foo.hpp"
foo<bar>::foo() { cout << "bar"; }
foo<baz>::foo() { cout << "开发者_如何学编程baz"; }
I'm using msvc 2008, is this the standard behavior?
Are only type template parameters cannot be linked to cpp files?You are specializing both forms of the contstructor. Why are you surprised it links both forms in?
精彩评论