I am trying to define a template member function in a class, and MSVC crashes everytime I try to build this code. I am not sure if this is a bug in Visual Studio 2008. Here is a minimal example.
testTemp.h
header file:
#pragma once
#include <vector>
#include <iostream>
class testTemp
{
public:
testTemp(void);
~testTemp(void);
template<typename T>
std::vector<T> m_vMonitorVec;
int MonitorSignal(T x, std::vector<T> vec, int len);
};
and here is testTemp.cpp
:
#include "StdAfx.h"
#include "testTemp.h"
testTemp::testTemp(void)
{
}
testTemp::~testTemp(void)
{
}
template<typename T>
int testTemp::MonitorSignal(T inp, std::vector<T> monVec, int len)
{
return 0;
}
and stdafx.h is:
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
I am running this in MSVC 2008, whenever I try to build this code, I get the following crash: