Boost logo

Boost :

Subject: Re: [boost] Some statistics about the C++ 11/14 mandatory Boostlibraries
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-05-15 11:36:57

On 14 May 2015 at 20:01, Emil Dotchevski wrote:

> I also wonder to what degree does anyone care that they have a mixture of
> e.g. std::function and boost::function in their code base. I'm probably
> biased because our corporate code base uses Boost and not std -- simply
> because using Boost makes our code more portable. I keep thinking that
> maybe at some point I'll switch everything to std but the way it's going, I
> don't see this happening within the next 3-5 years.

The clang moderniser should, one day in the future, do boost::* to
std::* conversions for you.

> > APIBind enables you to bind a copy of function<> into your library's
> > namespace e.g.
> >
> > namespace boost { namespace foo { template<class R, class... Args>
> > using function = std::function<R(Args...)>; } }
> >
> > You obviously wouldn't define that except when building under C++ 11
> > with std function enabled. function<> then resolves to either std
> > function or boost function as configured. Your library code is
> > unchanged, and doesn't care what the implementation is.
> >
> Would this work in case a header only declares shared_ptr, as in:
> namespace boost { template <class> class shared_ptr; }
> instead of
> #include <boost/shared_ptr.hpp>
> ?

I'm not sure what you mean here, but everything in APIBind works
header only. Indeed, APIBind is there to ensure that your library X
built against boost::function doesn't collide with your library X
build against std::function in the same translation unit.


ned Productions Limited Consulting

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