Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2003-10-30 19:30:59


On Thu, Oct 30, 2003 at 02:18:11PM -1000, David Abrahams wrote:
> Persson Jonas <jonas.persson_at_[hidden]> writes:
> > int main() {
> > typedef boost::variant<> Var0;
> > int s0 = boost::mpl::size<Var0::types>::type::value;
...
> > }
> >
> >>From this I expected the output:
> > 0,1,2,3
> >
> > but I got:
> > 1,1,2,3
>
> Well that's about as good as anyone could want, since there are no
> zero-sized types.

Looking closely, I don't think this is the issue.
The number he is printing is the compile-time-constant
length-of-list-of-types, and not the sizeof() any object, right?
You can have a zero-length MPL sequence, yes?

-- 
-Brian McNamara (lorgon_at_[hidden])

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