Subject: Re: [boost] Cxx dual library
From: Edward Diener (eldiener_at_[hidden])
Date: 2016-06-03 14:30:01
On 6/3/2016 11:17 AM, Thomas Heller wrote:
> Am 02.06.2016 8:56 nachm. schrieb "Edward Diener" <eldiener_at_[hidden]>:
>> I have finished all the main work on the Cxx dual library at
> https://github.com/eldiener/cxx_dual. The library is also in the Boost
> Library Incubator at
>> The Cxx dual library, or CXXD for short, is a C++ macro header-only
> library which chooses between using a Boost library or its C++ standard
> equivalent library for a number of different C++ implementations, while
> using the same code to program either choice. An 'implementation' is a
> Boost library which has a C++ standard library equivalent whose public
> interfaces are nearly the same in both cases. An 'implementation' is called
> a 'dual library' in this documentation, or 'CXXD-mod' for short.
>> The library does this by defining object-like macros for including the
> appropriate header file and namespace or using either the Boost library
> version or the C++ standard library version of a particular dual library.
> CXXD currently supports twenty eight different dual libraries, where the
> Boost version and the C++ standard version is nearly interchangeable in
> some respects. CXXD also provides a macro-based solution for distinguishing
> between the Boost version and the C++ standard version of a dual library so
> that specific code for a particular dual library choice may be written in
> those cases where the public interfaces diverge.
> Personally, I'm not a big fan of such a solution, especially when those
> macros "leak" into the public interface. We had a similar interface which
> would automatically switch between std and boost function. The result
> looked nice at first sight, however the subtle differences between the two
> led to various problems, one of which was that documenting the public
> interfaces containing this macro was very difficult, where does it point to
> know? Where should we send users to who look for more information about
> this function type? Should they be aware of both? Switching compilers or
> even boost version and now suddenly everything seems broken?
> The solution for us was to just decide which one to use and go with it,
> setting the requirements to the used standard library/boost version as
You are not being very specific about the problems you encountered, so
it is really hard to respond to them.