I'm working on a C++ project under GCC 4.8.1. I have two getter/setter pairs:
LOGFONT GetTitleBarFont();
void SetTitleBarFont(LOGFONT titleBarFont);
std::wstring GetTitleBarFont();
void SetTitleBarFont(std::wstring titleBarFont);
But for some reason, GCC is telling me these aren't valid overloads.
error: 'std::wstring GetTitleBarFont()' cannot be overloaded
error: with 'LOGFONT GetTitleBarFont()'
I don't understand what the issue here is. std::wstring
is a STL type (std::basic_string<wchar_t>
to be precise) with a host of template work behind the scenes. LOGFONT
is a Windows data type ( http://msdn.microsoft.com/en-us/library/windows/desktop/dd145037(v=vs.85).aspx ) composed almost entirely of native C++ datatypes (LONG
s, and BYTE
s, with an oddball TCHAR
array). How could these be ambiguous overloads?