Topic: deque< complex<double> >


Author: "Mark Sebern" <msebern@nospam.sebern.com>
Date: 1998/08/06
Raw View
I have seen this with other containers, including "vector".
It appears to be a problem with an explicit class specialization for
complex<double> (and other types). We reported this to Microsoft a long time
ago, but have not even received an acknowledgement. I can't be sure if it is
a compiler problem or a library problem, though I am suspicious of the
compiler since the template parameter "_Ty" is used at two levels (complex
and container). Perhaps someone here could comment if the standard says
anything about the possible reuse of template parameter names.

In at least one case, we got it to work by commenting out the class
specializations in <complex>.

Good luck.

-- Mark Sebern

Steve Rieman wrote in message <35c8c517.9731453@news>...
>Why does MS Visual C++ 5.0 choke on this (seemingly) simple STL
>example?
>
...
>typedef complex<double> CPD;
>typedef deque<CPD> DCPD;
>
>int main()
>{
>   DCPD foo;
>   return 0;
>}
>-------
...
>but the
>compiler reports:
>
>C:\Program Files\major\DevStudio\VC\Include\xmemory(33) : error C2300:
>'std::complex<double>' : class does not have a destructor called
>'~_Ty'





[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: "Donald Xie" <donaldRemoveThis@iinet.net.au>
Date: 1998/08/06
Raw View
Steve Rieman wrote in message <35c8c517.9731453@news>...
>Why does MS Visual C++ 5.0 choke on this (seemingly) simple STL
>example?
>
>---snip---
>#include <deque>
>#include <complex>
>
>using namespace std;
>
>typedef complex<double> CPD;
>typedef deque<CPD> DCPD;
>
>int main()
>{
>   DCPD foo;
>   return 0;
>}
>-------
>
>A deque is supposed to work if the template parameter has a default
>ctor,
>dtor, and assignment/copy.  The <complex> documentation says it does
>but the
>compiler reports:
>
>C:\Program Files\major\DevStudio\VC\Include\xmemory(33) : error C2300:
>'std::complex<double>' : class does not have a destructor called
>'~_Ty'
>

You need to update your header files, especially <xmemory> from Dinkumware:

http://www.dinkumware.com/vc_fixes.html

They have done a great job in fixing errors in VC header files.

Cheers
Donald



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: "P.J. Plauger" <pjp@dinkumware.com>
Date: 1998/08/06
Raw View
Steve Rieman <steve.rieman@SPAM.lmco.com> wrote in article <35c8c517.9731453@news>...
> Why does MS Visual C++ 5.0 choke on this (seemingly) simple STL
> example?
> .....
> typedef complex<double> CPD;
> typedef deque<CPD> DCPD;
> .....
> A deque is supposed to work if the template parameter has a default
> ctor,
> dtor, and assignment/copy.  The <complex> documentation says it does
> but the
> compiler reports:
>
> C:\Program Files\major\DevStudio\VC\Include\xmemory(33) : error C2300:
> 'std::complex<double>' : class does not have a destructor called
> '~_Ty'

You're hitting a compiler bug that causes problems in template function
_Destroy in <xmemory>. For a workaround, see:

http://www.dinkumware.com/vc_fixes.html

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com/hot_news.html



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: ncm@nospam.cantrip.org (Nathan Myers)
Date: 1998/08/06
Raw View
Steve Rieman<steve.rieman@SPAM.lmco.com> wrote:
>Why does MS Visual C++ 5.0 choke on this (seemingly) simple STL
>example?
>---snip---
>#include <deque>
>#include <complex>
>using namespace std;
>typedef complex<double> CPD;
>typedef deque<CPD> DCPD;
>int main() { DCPD foo; return 0; }
>-------
>...the compiler reports:
>
>C:\Program Files\major\DevStudio\VC\Include\xmemory(33) : error C2300:
>'std::complex<double>' : class does not have a destructor called
>'~_Ty'

Buggy compiler.

--
Nathan Myers
ncm@nospam.cantrip.org  http://www.cantrip.org/



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: steve.rieman@SPAM.lmco.com (Steve Rieman)
Date: 1998/08/05
Raw View
Why does MS Visual C++ 5.0 choke on this (seemingly) simple STL
example?

---snip---
#include <deque>
#include <complex>

using namespace std;

typedef complex<double> CPD;
typedef deque<CPD> DCPD;

int main()
{
   DCPD foo;
   return 0;
}
-------

A deque is supposed to work if the template parameter has a default
ctor,
dtor, and assignment/copy.  The <complex> documentation says it does
but the
compiler reports:

C:\Program Files\major\DevStudio\VC\Include\xmemory(33) : error C2300:
'std::complex<double>' : class does not have a destructor called
'~_Ty'

Any ideas?  Thanks in advance.

If mailing replies, remove SPAM

steve.rieman@SPAM.lmco.com



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]