|
Boost : |
Subject: Re: [boost] expected/result/etc
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2016-02-04 10:22:40
On 4 Feb 2016 at 14:45, Sam Kellett wrote:
> >>> Ordinarily yes. In this case however, the Boost-lite macros have the
> >>> same effect as the Boost ones, so redefining them is mostly safe,
> >>> albeit with annoying warnings.
> >>>
> >>>
> >> that's obviously not true seeing as somebody hit this problem seemingly
> >> almost immediately
> >>
> >>
> > Eh? That's exactly what happened. Annoying warnings with no other issues.
>
>
> sorry i don't think that came off how i meant it... what i mean is this is
> kinda asking for trouble. what happens if the boost macro changes?
>
> wouldn't something like this be better:
>
> #ifdef BOOST_XXX
> #define MY_XXX BOOST_XXX
> #else
> #define MY_XXX /* boost_lite thing here */
> #endif
>
> redefining a macro in somebody else's 'namespace' is akin to opening up the
> std namespace to redefine vector.
This is exactly what my Boost-lite emulation already does.
The problem is when you include my stuff first and then include Boost
without telling my stuff you actually want to use Boost, then Boost's
definitions collide with my emulated ones.
If Boost did as you suggested there would be no warnings, and I'm
defining the same functionally speaking thing as Boost is so there
should be no breakage (insert many caveats omitted for brevity here).
Niall
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk