Boost logo

Boost :

Subject: Re: [boost] [Config] Support for switching between std:: andboost:: equivalents.
From: Edward Diener (eldiener_at_[hidden])
Date: 2015-06-07 12:22:49


On 6/7/2015 10:36 AM, Peter Dimov wrote:
> Edward Diener wrote:
>> Most of the talk about the problems of my macro system presupposes
>> that programmers using Boost will mistakenly try to use a C++11
>> version of a library during a C++03 mode build and vice versa, and
>> therefore the system must be flawed.
>
> This was some of the talk but I'm not sure about "most". A substantial
> part of the talk was about programmers wanting to use boost::regex even
> when the compiler happens to be in C++11 mode. In other words, talk that
> challenges your assumption that
>
>> If the end-user of my library is compiling in C++11 mode is it more
>> likely that his use of regex will be std::regex or boost::regex ? IMO
>> it is the former.
>
> There are several good reasons to prefer boost::regex. First, the one I
> pointed out, you want to maintain a single code base that compiles under
> C++03 and C++11. Second, you want to use boost::regex's extensions that
> std::regex doesn't have. Third, you want predictable performance that is
> independent of the standard library in use.

If you use my macro system you can continue to maintain a single code
base under C++03 and C++11.

Sometimes it is the other way around and a C++ standard library
equivalent has functionality which its corresponding Boost library does
not have.

>
> On the other side of the coin, we have the desire to avoid use of Boost
> when use of standard facilities would suffice, which is real and
> legitimate. However, in my experience at least, this desire is only
> strong when you can avoid use of Boost _altogether_, which is not the
> case under discussion.

It is the case under discussion if there is no other use of Boost
libraries outside of the ones which have their equivalent in the C++
standard library for a given module.

If the above is not the case I don't think that the desire to avoid
using Boost altogether is realistic either. Boost has approximately 100
or so libraries which are not "duplicated" by C++ standard library
equivalents. Why would anyone refuse to use any of those 100 or so
libraries on principle if the use of a Boost library made their
programming easier ?

I understand that in the present incarnation of Boost as a single
distribution that the attempt to use C++ standard library equivalents to
Boost libraries when compiling in C++11 mode does not offer much of an
advantage. But if and when in a future incarnation of Boost an
individual Boost library, whether header-only or not, along with its
dependencies can be distributed and used outside the currently
monolithic Boost distribution it will be an advantage to be able to use
C++ standard library equivalents to Boost libraries.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk