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
using function = std::function ; } } 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
?
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. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/