Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2003-04-07 01:13:29


"Eric Friedman" <ebf_at_[hidden]> wrote in message
news:b6o6jp$qji$1_at_main.gmane.org...
> 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 the size of a type-sequence
(other
> than memory available to compiler, etc.).

Yes. You right. It's not hard limit. They both present *reasonable* limits.
You may choose some other third resonable limit for the number types you
support. I do not see any practiacal situation where one would want to
instantiate boost::variant with more then 1024 types. And ifyou want to
support even bigger numbers you could select the implementation of the
visitation algorithm by some PP flag.

> > 3. You could choose/define any other arbitrary limit (it should probably
> > exceed limits mentioned in items 1 and 2)
>
> I just think this is a bad idea. Loop-unrolling would provide O(1)
> complexity for some implementation-defined number of types and would not
> place any arbitrary limits on the user.

Could you clarify in which case loop-unrolling would provide O(1)
complexity?

Gennadiy.


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