Subject: Re: [boost] [random] example code fails inside struct
From: Vicente BOTET (vicente.botet_at_[hidden])
Date: 2011-04-16 06:55:31


> Message du 16/04/11 12:46
> De : "Beman Dawes"
> A : "Boost Developers List"
> Copie à :
> Objet : [boost] [random] example code fails inside struct
>
> struct X
> {
> boost::mt19937 rng;
> boost::uniform_int<> million(1,1000000); // VC++ 10 error C2059:
> syntax error : 'constant'
> boost::variate_generator >
> random_value(rng, million);
> };
>
> Why does the example code from the docs fail to compile when placed
> inside a struct or class? What am I missing?

I guess because you are initializing the fields in the declaration.
I'm missing something?

Best,
Vicente