More templated woes... I love C++, but sometimes I hate it.
I cannot figure out why the compiler is complaining here, and what I can do about it.
struct blah
{
template<class t>
blah(void(*)(t), t){}
};
void Func(int i) {}
void Func2(int& i) {}
void test()
{
int i = 3;
blah b(Func, i);
blah b2(Func2, i); //error C2660: 'blah::blah' : function does not take 2 arguments
blah b3(Func2, (int&)i); //error C2660: 'blah::blah' : function does not take 2 arguments
}
What is going on here?
I am using MSVC2008.