RE: visual c++ upgrading problem

Posted by cuchulainn on
URL: http://quantlib.414.s1.nabble.com/visual-c-upgrading-problem-tp3536p3542.html

Re: [Quantlib-users] visual c++ upgrading problem
Luigi,
problem is in VS > 6.0 that you MUST define a default constructor. So if you
 
generator(MersenneTwisterUniformRng() );

compiler looks for DefCon and does not find it. I think that this was a problem too.

 

regards

Daniel

 




From: Luigi Ballabio [mailto:[hidden email]]
Sent: Mon 24/01/2005 18:28
To: Luca Berardi
Cc: [hidden email]; Daniel J. Duffy
Subject: Re: [Quantlib-users] visual c++ upgrading problem

On 01/24/05 17:50:12, Luca Berardi wrote:
>
> ;; If you want to create a file, first visit that file with C-x C-f,
> ;; then enter the text in that file's own buffer.

Oh, an Emacs user. Nice :)


> Regarding Daniel's issue:
>
> Indeed I noticed the same behavior when playing with my code, trying
> to get around the problem related to the vexing parse. But I guess it
> is again related to the issue of the c++ most vexing parse.
> suppose I write:
>
>       BoxMullerGaussianRng<MersenneTwisterUniformRng>
>         generator(MersenneTwisterUniformRng() );
>       Sample<Real> currentSample = generator.next();
>
> The compiler signals an additional error saying that there is no
> appropriate default constructor.

I'm not sure I'm following. No appropriate default constructor for what?

> Indeed if you add a default constructor in the Sample<> class this last 
> error disappears, but the preceding one ("error C2228: left of '.next' 
> must have class/struct/union type") still remains.

Sample<> doesn't need a default constructor in the lines above---the copy 
constructor will be called, and that is automatically generated. Does the 
last error disappear once the vexing parse is fixed? It might be due simply 
to the compiler going berserk after it can't figure out the call to next...

Later,
        Luigi