Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2004-01-06 01:59:01


I've taken a quick stab at implementing a "TR pack" that tries to massage
Boost components to get them closer to conformance with TR1. To try it out,
grab:
  http://www.cs.rpi.edu/~gregod/trpack-20040106.tgz

And put it somewhere (it will extract into boost/tr1 for the headers and
libs/tr1/test for the very few tests I've done). You'll need Boost in your
path, and put the extracted boost/tr1 into your path as well. The supported
proposals are:

N1402, Polymorphic Function Object Wrapper.
N1403, Tuple Types
N1424, Type Traits.
N1432, Enhanced Member Pointer Adaptor.
N1450, General Purpose Smart Pointers.
N1453, Reference Wrapper.
N1455, Enhanced Binder.
N1454, Uniform Method for Computing Function Object Return Types. (Note: this
is from my implementation in the sandbox, and is not an official Boost
library)

There are some early problems, of course. First of all, several of these
components go into existing standard headers, e.g., <functional> or <memory>.
That means we need to intercept the header, include some Boost code,
introduce the new entities, and include the old header. Yikes!

Here's the (imperfect) scheme used above for augmenting, e.g., <functional>,
create a file "functional" with the following boilerplate:
  #ifndef BOOST_TRPACK_IN_BOOST
  # ifndef BOOST_TRPACK_TR1_FUNCTIONAL
  # define BOOST_TRPACK_TR1_FUNCTIONAL

  // Skip Boost additions from within Boost
  # define BOOST_TRPACK_IN_BOOST
  # include <boost/function.hpp>
  # undef BOOST_TRPACK_IN_BOOST

  namespace std { namespace tr1 {
    using boost::function; // this is the easy part
  } }

  # endif // BOOST_TRPACK_TR1_FUNCTIONAL
  #endif // BOOST_TRPACK_IN_BOOST

  // GCC extension. Do other compilers support it?
  #include_next <functional>

And to make matters worse, we'll need to define BOOST_TRPACK_IN_BOOST
basically whenever we include standard headers that TR1 proposals have
extended, so Boost CVS will have to change to make this work for real.

Anyway, assuming we can solve this problem, we can also pull in, with *I
think* not too much effort:
N1548, A Proposal to Add a Fixed Size Array Wrapper to the Standard Library
Technical Report
N1452, Extensible Random Number Facility.
N1530, Iterator Facade and Adaptor.
N1531, New Iterator Concepts.

This will need some work (a bit more than I have time for):
N1429, Regular Expressions.

This will need a whole lot of work:
N1422, Mathematical Special Functions.

This should be easy given Jeremy Maitin-Shepard's implementation:
N1456, Hash Tables.

Comments welcome, of course.

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk