Re: MSVC2005: problem with valarray<valarray<T> >

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Abdelrazak Younes" wrote:
I have an array (math) library that uses valarray. I have
no choice to use that for now so please don't tell me that
it is a bad implementation. I would like to know why this
code is working fine with previous version of MSVC (with
or without STLPort) but not in MSVC2005, though it seems
to work fine with STLPort. My array class are like below:

template <class T> class array1d: public valarray<T> {...}

template <class T> class array2d: public array1d<
array1d<T> > {...}

Both classes implement a virtual default constructor.

When I create an instance of array2d<double> the code
crashes at construction. The weird thing is that the
array2d constructor calls the array1d destructor and
that's were it crashes...


Did you mean virtual destructor? Constructor cannot be
virtual. Also, provide some minimal example, which exposes
the problem.


.



Relevant Pages

  • std::vector constructor wierdness
    ... default constructor didn't initialize a vector properly. ... I need to know how to fix it. ... STLport 5.1.5 to replace the vector functions but it is seldom used with this ...
    (microsoft.public.vc.stl)
  • Re: MSVC2005: problem with valarray >
    ... I have an array library that uses valarray. ... I would like to know why this code is working fine with previous version of MSVC (with or without STLPort) but not in MSVC2005, though it seems to work fine with STLPort. ... The weird thing is that the array2d constructor calls the array1d destructor and that's were it crashes... ...
    (microsoft.public.vc.stl)
  • Re: MSVC2005: problem with valarray >
    ... I have an array library that uses valarray. ... I would like to know why this code is working fine with previous version of MSVC (with or without STLPort) but not in MSVC2005, though it seems to work fine with STLPort. ... The weird thing is that the array2d constructor calls the array1d destructor and that's were it crashes... ...
    (microsoft.public.vc.stl)
  • Re: MSVC2005: problem with valarray >
    ... The weird thing is that the array2d constructor calls the array1d destructor and that's were it crashes... ...
    (microsoft.public.vc.stl)