|
Boost : |
From: Alan Bellingham (alan_at_[hidden])
Date: 2002-07-18 10:27:17
Bill Kempf:
>You could argue that "it does the right thing" when it compiles with your
>solution, but this is a change in behavior, not a "fix" for the macro misuse
>in the Windows API.
I would indeed argue that ... I _like_ the overloading, and thus far,
this file has been for my use only.
> I'd support a fix like the one I give above (and hope
>that MS does this themselves someday soon, since a user header that does
>this is only going to be problematic with regards to inclusion order), but
>I'd oppose one like you gave.
I also agree that the best solution would be MS 'fixing' their headers
for the reason you give.
Anyway, there's always the possibility of doing both:
#if defined(CharLower)
# undef CharLower
# if defined(ALLOW_OVERLOAD)
inline char * CharLower(char * Src) { return CharLowerA(Src); }
inline wchar_t* CharLower(wchar_t* Src) { return CharLowerW(Src); }
#else
# if defined(UNICODE)
inline wchar_t* CharLower(wchar_t* Src) { return CharLowerW(Src); }
# else
inline char* CharLower(char* Src) { return CharLowerA(Src); }
# endif
#endif
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk