Gennadiy Rozental wrote:
1. There is theoretical limits for the size of MPL sequences. See MPL
docs
(BOOST_MPL_LIMIT_LIST_SIZE for list)
2. You could limit variant support only for lists that does not exceed
your
own limit BOOST_VARIANT_LIMIT_TYPES.
Not true. There is absolutely no limit on
Eric Friedman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Gennadiy Rozental wrote:
While I do agree O(1) is better than O(N), I would like to point out
that
it is usable only when the pseudo-variadic template interface is used
(i.e.,
variantT1, T2, ..., TN as opposed to
Gennadiy Rozental wrote:
Eric Friedman [EMAIL PROTECTED] wrote:
[snip]
If variant is given types as a MPL-sequence (e.g., variant
mpl::listT1,
T2, ..., TN instead of variantT1, T2, ..., TN), then technique you
propose will not work. Please prove me incorrect, but I don't think you
can.
case MAX_WITCH:
visitor( Typelist[MAX_WITCH](storage) );
break;
}
}
Your pseudo-code is misleading. There is no MAX_WHICH available to the
preprocessor when MPL-sequences are given because there is no theoretical
upper limit on the size of a
Gennadiy Rozental wrote:
While I do agree O(1) is better than O(N), I would like to point out
that
it is usable only when the pseudo-variadic template interface is used
(i.e.,
variantT1, T2, ..., TN as opposed to variantTypes).
Why? And to be absolutely clear: what do you mean by it?
By
Gennadiy Rozental wrote:
8. Visitation algorithm
In sketch presented visitation algorithm look like this:
void foo1( which, visitor )
{
if( n = 1 )
visitor(...)
else
foo2( which, visitor );
}
void foo2( which, visitor )
{
if( n = 2