[C++-sig] Re: indexing_v2 status update

Raoul Gough RaoulGough at yahoo.co.uk
Thu Jan 22 12:10:10 CET 2004


Joel de Guzman <joel at boost-consulting.com> writes:

> Raoul Gough wrote:
[snip]
>> I've tested this much under gcc 3.3.1 and MSVC6.0 and 7.1. So before I
>> get too carried away and convert everything to this new style, does
>> Dave, Joel, or anyone else have comments or suggestions?
>
> Looks cool to me ;-) My only concern is: what if the bits of an
> unsigned int runs out? Unlikely? What if the methods identifiers
> are types instead in a special namespace and specifying the
> methods is done using an mpl typelist? Example:
>
> container_suite<C, mpl::list<method_len, method_getitem, method_getitem_slice> >

Well, that's a good question. There are a number of possible methods
that aren't included yet - things like pop, clear and the arithmetic
operator support (__iadd__, __radd__, etc.) I haven't counted them up,
but there are two possible solutions if the bitspace runs out: (1)
select the new methods in groups (e.g. method_all_arithmetic) or (2)
add a new unsigned template parameter for the "advanced" features.

Dave and I discussed using a typelist, but I decided against them
because of their complexity and my doubts about mpl::set, which would
be the appropriate data structure in this case. Maybe it would be
possible to do it with mpl::list - I'll have a look into it. BTW,
aren't there compilers that have limited template recursion depth,
which would also impose a restriction on the number of elements in a
list/set?

-- 
Raoul Gough.
export LESS='-X'





More information about the Cplusplus-sig mailing list