Boost logo

Boost :

Subject: Re: [boost] question about C++11 guidelines
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2012-05-03 07:16:12

Eric Niebler wrote:
> Say I'm rewriting an existing Boost library and targeting
> C++11 users. I plan to ship C++03 and C++11 versions of my
> library side-by-side, so back-compat isn't an issue for the new
> code. Is there a reason to prefer using Boost's versions of
> utilities like enable_if, type traits, integral constant
> wrappers (e.g. mpl::int_), tuples, etc., over the now-standard
> ones?
> I'm leaning toward using std:: where I can, and falling back
> on Boost's versions only when there is a compelling reason.

If every Boost component on which you relied had a C++11 mode, whereby it was just an alias for the corresponding standard component, then you could use the Boost components because clients could be sure to get standard only code when they want it, or switch off C++11 mode and get the Boost compatibility versions where necessary. That way, those wanting pure, standardized C++11 code could get it, while those without a suitable platform, can still use your library.

The problem is that few, if any, Boost components are fully compatible with their standard counterparts and provide such a switchable design. Therefore, it seems that a C++11-only library should use only standard components. If those components are insufficient, I'd go so far as to say that C++11-only Boost components should be created to fill the gaps. IOW, once you head down the C++11-only path, you should not pollute it with C++98/03 noise. Otherwise, you may as well stay on the Boost-based compatibility path.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP


IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

Boost list run by bdawes at, gregod at, cpdaniel at, john at