
Douglas Gregor wrote:
On Sat, 2007-10-27 at 11:08 -0400, Arkadiy Vertleyb wrote:
"Eric Niebler" <eric@boost-consulting.com> wrote
In order for BOOST_TYPEOF to work with xpressive's static regexes (something I'm actively trying to support), I need registrations for reference_wrapper<> and mpl::int_<>. I'm happy to add them, but I'm not sure where. Thoughts? <snip>
There are several libraries that have this kind of problem. typeof needs registrations, serialization needs serialize() functions, MPI needs datatype traits, etc. I wonder if we can solve this problem for all of Boost with some kind of automatic scheme that says: if you include header A from one library and header B from another library, you automatically get whatever glue makes A and B work well together.
It's relatively simple to implement this for two headers. In header A you have:
#ifdef HEADER_B_INCLUDED # include <glue_a_and_b.hpp> #endif
In header B you have:
#ifdef HEADER_A_INCLUDED # include <glue_a_and_b.hpp> #endif
I don't think this is a very good idea. Take a really basic example like boost/ref.hpp, that is included *everywhere*. Are you really going to add PP blocks like this to ref.hpp for every library in boost that includes it? That would be almost every library in Boost, and it would be an continuing maintenance problem for the author of ref.hpp. I think the better solution is the one Arkadiy suggested ... that there is a dedicated place for such registrations so interested parties can add them if they need them. I'd be happy with his suggestion of $BOOST_ROOT/boost/typeof_registrations/<library>/. -- Eric Niebler Boost Consulting www.boost-consulting.com