Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2004-08-02 08:07:24

Dr Jekyll <drjekyll_at_[hidden]> wrote:
> Hi,
> I use a library, which itself use Boost. This library define
> #define Handle boost::shared_ptr


> But because I intende to use WINAPI , this definition results
> in a conflict
> c:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\PlatformSDK\Include\WinUser.h(3282): error C2751:
> 'boost::shared_ptr' : the name of a function parameter cannot
> be qualified
> What should I do, if I have to keep the #define line in my library...

Don't use that library. Its code quality is so low that you will
probably waste more time working around its bugs then you can
save by using it.

If you disagree with this assessment, perhaps you could write and
use a wrapper header that does something like:


    #include "library.h"
    #undef Handle
    // undefine any other unwanted macros

    #endif // !defined(LIBRARY_WRAPPER_H)

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at