This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Apache and standard C++ library


On Wed, 18 May 2005 14:26:00 +0100, Jonathan Wakely wrote:
> To be link-compatible you can avoid using std::allocator and explicitly
> use e.g. __gnu_cxx::__mt_alloc but then you have vendor lock-in since
> that type is specific to GCC/libstdc++.

Right. I guess my point was that if __gnu_cxx::__mt_alloc was source
compatible with std::allocator you can just tell people to #define or
typedef (or some other switching mechanism) between them, eg in the
libstdc++ headers have a:

#ifdef __GCC_MT_ALLOC__
typedef std::allocator __gnu_css::mt_alloc;   // or whatever
#endif

and then people can opt in to the new features by defining the right
macros. This way you don't get a silent dependency on newer versions of
the toolchain if you don't want them.

Feature changes could be batched as well, so you can just #define
something that says "I want all binary incompatible but source compatible
changes made after version XYZ please".

thanks -mike




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]