Re: visual c++ upgrading problem
Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/visual-c-upgrading-problem-tp3536p3545.html
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