I have this code in my unit test:
Assert::AreEqual(std::chrono::system_clock::now(), ntp.testntp);
and I get this error:
Error 1 error C2338: Test writer must define specialization of ToString<const >Q& q> for your class class std::basic_string<wchar_t,struct >std::char_traits<wchar_t>,class std::allocator<wchar_t> > __cdecl >Microsoft::VisualStudio::CppUnitTestFramework::ToString<class >std::chrono::time_point<struct std::chrono::system_clock,class >std::chrono::duration<__int64,struct std::ratio<1,10000000> > >>(const class >std::chrono::time_point<struct std::chrono::system_clock,class >std::chrono::duration<__int64,struct std::ratio<1,10000000> > > &).
It's my understanding that you have to do something along these lines:
template<> static std::wstring ToString<system_clock>(const system_clock& t) { RETURN_WIDE_STRING(t); }
The compilier doesn't like the RETURN_WIDE_STRING(t)
part.
How do I properly do this?