Boost logo

Boost :

Subject: Re: [boost] RFC: type erasure
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2011-05-22 19:58:49


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. 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.

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.

-- 
-Matt Calabrese

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