|
Boost : |
Subject: Re: [boost] [type_erasure] Review ends today July 27, 2012
From: Joel de Guzman (joel_at_[hidden])
Date: 2012-08-01 08:34:39
>>>> Please state clearly whether you think this library should be accepted
>>>> as a Boost library.
Yes. I vote to accept.
>>>> Other questions you may want to consider:
>>>> 1. What is your evaluation of the design?
Outstanding.
>>>> 2. What is your evaluation of the implementation?
Haven't looked.
>>>> 3. What is your evaluation of the documentation?
I just skimmed through the docs to get what I need (see below). It
would be good to have examples at the bottom of each of the reference
sections like that of MPL, Fusion and the PPlib. Example:
http://www.boost.org/doc/libs/1_50_0/libs/mpl/doc/refmanual/fold.html
At the bottom, we have an example.
>>>> 4. What is your evaluation of the potential usefulness of the library?
Extremely useful!
>>>> 5. Did you try to use the library? With what compiler? Did you have
>>>> any problems?
Yes. I tried to use it as a replacement for Boost.Function in Boost.Spirit.
It worked like a charm. My only difficulty was in trying to figure out
how to detect a default-initialized 'any'. With Boost.Function, you can use
an instance in a condition, e.g. if (f) ... This seems to be not the case
with 'any'. I'm pretty sure this is something simple to do, but I can't dig
it out in the docs. I ended up casting to void*. It turns out that it returns
0 (null) if any hasn't been initialized yet. I'm not sure about the cost of
that though (would that have to use RTTI? It seems that way as it says in
the any_cast docs: http://tinyurl.com/d8sx46m where it says that typeid_
is required.
I did a CT test on one of the largest examples in spirit. I compared
it against 1) the original implementation using Boost.Function and
2) A hand-coded implementation using virtual functions. Here are
the results:
TypeErasure: 01:14 secs
Boost.Function: 00:55 secs
Virtual Function: 00:52 secs
For that matter, I'm not ready to use TypeErasure yet for my purpose,
but I'm hoping that Steven can improve CT. It might also be possible
that I am using TypeErasure incorrectly when I resort to any_cast to
test for null any. Would this explain the CT slowdown? I am not sure.
I'd also suggest the addition of an easy to use Boost.Function
replacement in there that can be used out of the box with full
compliance.
I know this is merely scratching the surface, but I am sure I'll
be using TypeErasure's more powerful features.
>>>> 6. How much effort did you put into your evaluation? A glance? A
>>>> quick reading? In-depth study?
A few hours of study.
>>>> 7. Are you knowledgeable about the problem domain?
I believe so.
Regards,
-- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk