On 15 May 2015 at 20:29, Peter Dimov wrote:
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.
Does this actually work? Because I've trouble visualizing it based on this description.
OK, X built against boost::function has
namespace boost { namespace foo {
template
using function = boost::function ; } }
and X built against std::function has
namespace boost { namespace foo {
template
using function = std::function ; } }
Correct.
Why do those two not clash? I'm not seeing it. Perhaps the two 'foo' namespaces are actually different?
Correct:
namespace boost { namespace foo { inline namespace ???_boost_??? {
template
But if so, does this not lead to a combinatorial explosion when more than one component can use either its Boost or standard version? function, bind, shared_ptr, regex... that's 16 combinations so far.
Correct. This was raised in Q&A in the talk too. I would suggest pruning the combinations in this case to a reasonable subset, though I have a python script which generates the macro boilerplate for you so you don't have to. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/