Boost logo

Boost :

Subject: Re: [boost] RFC: type erasure
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-05-24 02:34:58


Steven Watanabe-4 wrote:
>
> AMDG
>
> On 05/23/2011 02:34 PM, Vicente Botet wrote:
>> I would try to study more deeply your design in order to see the
>> advantage
>> it could provide to my library. While developing Boost.Opaque (available
>> on
>> the sandbox
>> https://svn.boost.org/svn/boost/sandbox/opaque/libs/opaque/doc/html/index.html),
>> I was confronted to a similar problem, that is, how to add in a
>> declarative
>> way, more operations to the underlying class. I have reached to manage
>> with
>> this using what I have called a meta-mixin.
>>
>> A MetaMixin is a meta-function having as nested type a Mixin. The
>> archetype
>> of a MetaMixin is
>>
>> struct MetaMixinArchetype {
>> template (*typename Final, typename Base*)
>> struct type : Base
>> {
>> ...
>> };
>> };
>>
>> Metamixins are is a similar way to your concepts, passing them in a
>> mpl-sequence.
>>
>> I will appreciate a lot if you can take a look and comment the design of
>> Boost.Opaque.
>>
>
> It looks like your MetaMixin is pretty much
> equivalent to what I did with concept_interface.
> For what you're trying to do, I don't see that it
> can really be improved much.
>

Thanks for your advice.

> I'd say that for the most part, you're better
> off without the extra complexity in my design.
> I have to generate both the interface and the
> dispatching code from a single specification.
> You only need to define forwarding functions.
>
>

Why do you needed to generate the interface and forwarding the call
separately?
Is because you want in addition to be able to emulate concept maps?
Aren't type-erasure and concepts orthogonal?

What I mean is that your library is doing concept-erasure and that trying to
solve just type-erasure could maybe be simpler.

I'm wondering if type_erasure had a MPL sequence of something like my
meta-mixins, the meta-mixing could always forward the call to a concept
adapter if what we want is concept erasure.

Please note that I don't understand yet the whole design of
Boost.TypeErasure.

Best,
Vicente

--
View this message in context: http://boost.2283326.n4.nabble.com/RFC-type-erasure-tp3542886p3546242.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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