std::wstring timeString();
This is a function declaration, not object declaration. Look it carefully : the function name is timeString
which takes no argument, and returns std::wstring
.
Just write:
std::wstring timeString;
That should be enough.
Only if you prefer C++11's uniform initialization syntax, you could avoid such accidental error:
std::wstring timeString { L"some text" }; //object!
std::wstring timeString { }; //object, not function declaration!
Hope that helps.