我想为CPPUNIT_ASSERT_EQUAL_MESSAGE(string message, T expected, T actual)
. 我试过了:
template<class T> void (&_assert)(string, T, T) = &CPPUNIT_ASSERT_EQUAL_MESSAGE;
不确定它是否正确,但我收到了类似的错误
Error 1 error C2530: '_assert' : references must be initialized h:\dropbox\sch\cs3202\code\test\testqueryevaluator\testgetcandidatelist.h 22
Error 2 error C2998: 'void (__cdecl &__cdecl _assert)(std::string,T,T)' : cannot be a template definition h:\dropbox\sch\cs3202\code\test\testqueryevaluator\testgetcandidatelist.h 22
什么是正确的语法?