Boost logo

Boost :

Subject: Re: [boost] [type_erasure] Review started (July 18-27,2012)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-07-26 10:07:41


AMDG

On 07/26/2012 02:57 AM, Christophe Henry wrote:
> Hi all,
>
> here's my review for TypeErasure.
>

Thank you very much for your review.

>> Please state clearly whether you think this library should be accepted
>> as a Boost library.
>
> Let's answer this upfront: YES!
>
>> Other questions you may want to consider:
>> 1. What is your evaluation of the design?
>
> Seen from outside, the design is clean and allows powerful constructs.
>
>> 2. What is your evaluation of the implementation?
>
> I only had a quick glance.
>
>> 3. What is your evaluation of the documentation?
>
> What is there is very good, but we could do with more documentation. A
> few suggestions:
> - provide a small example of usage of each concept to help new users
> manage faster the learning curve.
> I had some difficulties getting istreamable working and had to look at
> the tests to finally get it.

Okay.

> - provide more real-looking examples of the sort of the polymorphic
> range formatter. The more the better. I'll myself provide one later on
> in this message.
>
>> 4. What is your evaluation of the potential usefulness of the library?
>
> Huge! And by this I mean a very interesting programming style which
> should be made available also to average programmers.
> Which makes the doc even more important.
>
>> 5. Did you try to use the library? With what compiler? Did you have
>> any problems?
>
> Yes, on a real private project I do on my free time. I used VC9. I'm in
> vacations so I couldn't try gcc and VC10 yet but I'll do this in the
> next few weeks.
> I got no problem besides a single warning about unused variable (fixed).

Good to hear.

> I tried the library for 2 different use cases:
> - a streamable any (actually I need a boost-serializable any but didn't
> come to it yet). One always needs something like this. In the past, I
> had to modify a Boost.Any to achieve this. In my design, this helps
> implement my low-level saving/loading to/from file easily as the low
> level layer needs no knowledge about the types it gets, they're just a
> bunch of serializable things.
>
> - improve my MVC (Model-View-Controller) design. Here's my use case: I
> started with a classical (OO style) interface-based design a graphical
> editor where the user can place and edit items of different kinds on a
> drawing area. The interface for these items is something along the lines:
> <snip example>
>

This looks great. I'll work this into
a complete example.

> There is only one thing missing to be able to throw away all these
> interfaces: the ability to navigate through dynamic/static cast in the
> hierarchy. TypeErasure supports upcasting of concepts but not
> downcasting. According to Steven, this would be possible.
> I won't make it an acceptance condition, but I could make good use of
> this feature. My use case: different view items get an IItem, then a
> view Item for Type1 would safely cast down its IItem to IType1. This is
> at the moment not possible with TypeErasure. I view this as a killer
> feature, so I can only advise providing it at a later point.
>

I hadn't considered this very important, but
you're the second person to request this, so
I'll bump up it's priority.

> One last request: I would like the possibility to read the concept of an
> any through a metaprogram. I found this:
> /** INTERNAL ONLY */
> typedef Concept _boost_type_erasure_concept_type;
>
> I try to avoid using internals, could this be made part of the public
> interface?

This is provided as a metafunction concept_of.

In Christ,
Steven Watanabe


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