I want to make a simple message template class as follows. I followed the structure verbatim from the chosen answer posted here. However, this seems to break in Visual Studio 2013.
template<typename T> Message;
template<> Message <std::vector<uint8_t>>
{
public:
};
template<> Message <std::string>
{
};
IntelliSense tells me that Message is not a template
.
Placing class
before Message
in the forward declaration results in a slightly better, but equally annoying IntelliSense error: expected and identifier
after the opening brace {
of each template.
template<typename T> class Message;
template<> Message <std::vector<uint8_t>>
{
public:
};
template<> Message <std::string>
{
};
I should note that all the above code is currently being placed in a header file.
You need to include the
class
keyword in the template specialization as well. I don't know why the linked answer doesn't do that.