Is it possible to achieve something like this:
Code:
template<typename StrT> struct InputTraits { };
template<> struct InputTraits<const wchar_t*>
{
static decltype(std::wcout) & OutStream;
static decltype(std::wcin) & InStream;
};
template<> decltype(std::wcout) & InputTraits<const wchar_t*>::OutStream = std::wcout;
template<> decltype(std::wcin) & InputTraits<const wchar_t*>::InStream = std::wcin;
...Somehow, some way? I figured that depending on if the type T is const wchar_t* or const char* or some other type such as std::string or std::wstring, I could make a struct which contains a reference to the standard input and output for that particular type.
Of course, this just spits back errors at me.