
On Monday 08 June 2015 11:12:19 Gavin Lambert wrote:
On 5/06/2015 20:31, Andrey Semashev wrote:
The reason of Boost.WinAPI existence is that people don't want to include windows.h, especially in public headers. It is a heavy header that brings in most of SDK. It depends on predefined macros, so including it once defines the API users will be able to use; this is inconvenient for both Boost and its users. Also, windows.h defines a few offending macros, like min/max.
I'm not sure why this is a desirable goal. Any user application is almost guaranteed to #include
at some point -- it's the platform header, you can't really accomplish anything of value without doing so at some point, except in very trivial cases. (Just like any non-trivial Linux app is likely to include one of the sys/ headers at some point.)
By not including windows.h in Boost we let the user decide what features of windows.h he wants to use and not depend on his choice. This is much less of a problem with POSIX headers because they are more fine grained and do not depend on predefined macros so much.