Boost logo

Boost :

Subject: Re: [boost] C++03 / C++11 compatibility question for compiled libraries
From: Nevin Liber (nevin_at_[hidden])
Date: 2018-02-09 21:25:13


On Fri, Feb 9, 2018 at 2:26 PM, Edward Diener via Boost <
boost_at_[hidden]> wrote:

> I am all for C++03 libraries upgrading their implementation if a later
> version of C++ drops support for a previously supported standard library. I
> was one of the many people who worked to change a number of Boost libraries
> from using std::auto_ptr to using std::unique_ptr when it was appropriate.
>

I'm not. For instance: if the library author wishes to make an
improvement to their library that they may eventually propose to the
committee, they can modify their Boost library and and get user experience.

What someone could do is something like (caution: pseudocode):

#if c++03 or earlier
#include <boost/shared_ptr.hpp>
namespace boost { namespace stl {
    using boost::shared_ptr;
    using boost::weak_ptr;
    using boost::enabled_shared_from_this;
    // ...
}}
#else
#include <memory>
namespace boost { namespace stl {
    using std::shared_ptr;
    using std::weak_ptr;
    using std::enabled_shared_from_this;
    // ...
}}

While that certainly doesn't solve all issues, it might help.

If it is something we wanted, we could either encourage library maintainers
to do so when their library gets standardized or someone could propose it
as a separate library.

Anyway, just a thought...

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden] <nevin_at_[hidden]>>
+1-847-691-1404

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