Boost logo

Boost :

Subject: Re: [boost] RFC: type erasure
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-05-22 20:32:27


AMDG

On 05/22/2011 04:58 PM, Matt Calabrese wrote:
> On Sun, May 22, 2011 at 7:27 PM, Steven Watanabe <watanabesj_at_[hidden]>wrote:
>
>> Thanks. It would be awesome if we could integrate
>> this with your Generic library, so a single concept
>> definition is sufficient for both.
>
>
> Yeah, that would be amazing. I bet we could get something workable with
> simple concepts in not too much time, though right now I have other
> priorities for the library (I want to first get all of the concepts of N2914
> working and tested). The complicated parts of applying type erasure here
> that I can think of are with associated types -- for instance, a type-erased
> container should probably automatically be working with type-erased
> iterators, right? So handling things correctly implies my library figuring
> out all of the constraints that affect an associated type in any way, which
> could be tricky, as constraints can be scattered around the encapsulating
> concept. While I can check the constraints fine, at a high level I don't
> really know which constraints affect which types, whether directly or
> indirectly, if you get what I'm saying.

Yeah. I don't really have a good way to
handle associated types at all. I suspect
that the way I'm using placeholders will
interact badly with associated types in your
macros.

> All I know is whether a given
> constraint is satisfied or not, but it's difficult to determine exactly
> which associated types are affected by which constraints since they can be
> referenced in any kind of arbitrary type expression.
>

If the constraint is of the form SomeConcept<A, B, C>,
I can use placeholders for the arguments, and pick it
apart with TMP.

> Anyway, this would be awesome to accomplish, especially if we could figure
> out a way to handle the general case, though, at least at my end, it's a
> ways off. I feel like Sean Parent talked a little bit about similar
> functionality with Poly. I'll check it out and try to keep all of this
> somewhere in my mind as I make further progress with the Generic library.
>

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