Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2004-07-24 06:29:45


"Andy Little" <andy_at_[hidden]> wrote

> I will definitely aim to try it out in depth with my physical quantities
> library in VC7.1, hopefully within couple of weeks. Two obvious points to
> look for are
>
> 1) How easy is it for the user (ie me) to implement in practise.

Quite easy, IMO, and totaly non-intruisive. You just have to tell the
typeof library about your types (name) and templates (name and the number of
parameters). For the example with Lambada, that I provided before, this
would mean to write something like following:

BOOST_TYPEOF_REGISTER_TEMPLATE(boost::tuples::tuple, 2);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::lambda_functor, 1);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::lambda_functor_base, 2);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::relational_action, 1);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::logical_action, 1);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::other_action, 1);
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::greater_action);
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::less_action);
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::and_action);
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::placeholder<1>);
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::placeholder<2>);

After this you can use any combination of registered types/templates (and
primitive types, which are registered by the typeof library) -- the system
will be able to process it.

> 2) How much does it affect compile times.

Well, it does affect it. On my 1.5GHZ PC, VC7.1, it takes 2 to 3 sec to
process the above-mentioned Lambda expression (I do not count the time
needed to #include my stuff, as well libraries that I use -- in VC7.1 you
can almost eliminate it by using pre-compiled headers).

> Because my library is not boosted it will be a more interesting test.

OK, but I assure you that there is nothing in the typeof system that makes
it easier to use with boostified libraries.

Regards,
Arkadiy


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