Topic: VC++ Conformance ( was We have a standard! )


Author: Peter Claussen <boots@itctel.com>
Date: 1998/08/05
Raw View
In article <MPG.10242a896750f29f989687@1.2.3.200>,
  phulakes@DIESPAMDIEbmarket.com (Ashley Fryer) wrote:
>
>
> Could you be more specific about the problems you see in VC++?
>
> I use VC5 ( not MFC ) and have followed the standard for years.  My
> experience has been that although not fully conformant, VC is at least as
> close as any alternative.  What are you seeing that I don't?
>
> Regards,
> ashley
>

I had a problem using dynamic_cast<...> with Visual C++ to typecast in
MFC. I can't remember the details, but it seems that I put the cast
inside a try{} block, but instead of throwing an exception the program
would die a horrible death. I gave up on it and found another way to
solve my problem. However, I'm still using more standard (C) style casts
than I would like.


[ 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: tlhol@ibm.net (Thomas Holaday)
Date: 1998/08/04
Raw View
> > In article <35ba433b.1405020@nntp.interaccess.com>,
> > olczyk@interaccess.com says...
> >
> > Could you be more specific about the problems you see in VC++?
> >

My current favorite is the implementation of set_new_handler.  If a
program calls set_new_handler with (of all things) a non-null
new_handler, an assertion failure occurs.  The debugger brings up a
source file which suggests one use _set_new_handler instead.
---
[ 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: abell8920@mindspring.com (Andrew Bell)
Date: 1998/08/01
Raw View
On 30 Jul 1998 17:03:21 -0400, "Alberto Barbati" <albbarbZZZ@tin.it>
wrote:
>Nope, VC5++ does not support partial specialization at all.

Actually, it's slightly worse than that, in that Visual will often
compile *but ignore* partial specialization.  It also doesn't complain
about certain things in uninstantiated templates that other compilers
will complain about (in my case, Metrowerks), but I can't say for
certain whether that's a problem with VC or with Metrowerks.

Andrew Bell

      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]
---
[ 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: jcoffin@taeus.com (Jerry Coffin)
Date: 1998/08/01
Raw View
In article <35bf5903.0@news.metro.net>, wade_ost@metro.net says...

[ ... ]

> Something that perhaps is more in the realm of an error came up in my
> explorations of the cryptic stream classes. I was using an 'istream' and was
> trying to copy a range of bytes from that to an 'ostream.' There is a method
> called 'get' which can read bytes from a stream buffer. The docs say the
> param is a basic_streambuf*

The error here is in the documentation, not the code -- istream::get
is supposed to take a reference rather than a pointer.

> but the implementation uses a reference. So I had to throw a '*' in:
>
>   istream input;
>   ostream output;
>     ...
>   // Copy over the client data. WHOA! Apparent MS STL implementation
>   // error. Docs refer to this param as a basic_streambuf*, but in
>   // "istream" it is defined as as reference. Other implementations
>   // may have to use input.get(output.rdbuf(), size), instead.
>   input.get(*output.rdbuf(), size);

Other implementations should use the same code as VC++: rdbuf is
supposed to return a pointer, and get is supposed to take a reference
as a parameter.  (at least according to CD2, 27.6.1.3 paragraph 12 or
thereabouts...)

--
    Later,
    Jerry.

The Universe is a figment of its own imagination.

      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]
---
[ 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: Jason Merrill <jason@cygnus.com>
Date: 1998/08/03
Raw View
>>>>> Andrew Bell <abell8920@mindspring.com> writes:

> It also doesn't complain about certain things in uninstantiated templates
> that other compilers will complain about (in my case, Metrowerks), but I
> can't say for certain whether that's a problem with VC or with
> Metrowerks.

Well, that depends.  The standard says that the compiler can choose to
diagnose syntax errors when the template definition is seen or wait until
instantiation time.

Jason
---
[ 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: "Mike Ost & Martha Wade" <wade_ost@metro.net>
Date: 1998/07/30
Raw View
Ashley Fryer wrote in message ...
>Could you be more specific about the problems you see in VC++?

Something that perhaps is more in the realm of an error came up in my
explorations of the cryptic stream classes. I was using an 'istream' and was
trying to copy a range of bytes from that to an 'ostream.' There is a method
called 'get' which can read bytes from a stream buffer. The docs say the
param is a basic_streambuf* but the implementation uses a reference. So I
had to throw a '*' in:

  istream input;
  ostream output;
    ...
  // Copy over the client data. WHOA! Apparent MS STL implementation
  // error. Docs refer to this param as a basic_streambuf*, but in
  // "istream" it is defined as as reference. Other implementations
  // may have to use input.get(output.rdbuf(), size), instead.
  input.get(*output.rdbuf(), size);

This took me forever to figure out, trying to wade through all that cryptic
mish-mosh of the new C++ header files (templates are cool, but they make my
head ache and my eyes spin to try to figure out).
---
[ 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: "Alberto Barbati" <albbarbZZZ@tin.it>
Date: 1998/07/30
Raw View
fvali@biotrack.com ha scritto nel messaggio
<6pi7se$nmp$1@nnrp1.dejanews.com>...
>In article <MPG.10242a896750f29f989687@1.2.3.200>,
>  phulakes@DIESPAMDIEbmarket.com (Ashley Fryer) wrote:
>
>Amongst some of the non-conformant issues I have encountered, here is an
>example, right from the CD2 draft, regarding partial specialization:
>
> [snip]
>
>Is there some switch that needs to be turned on in VC5++ to get this to
>compile properly? -fais

Nope, VC5++ does not support partial specialization at all.

--
Alberto Barbati
Please remove ZZZ from my e-ddress when replying
---
[ 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: phulakes@DIESPAMDIEbmarket.com (Ashley Fryer)
Date: 1998/07/27
Raw View
In article <35ba433b.1405020@nntp.interaccess.com>,
olczyk@interaccess.com says...
>
> Not only will they not make it any closer, but they will add a lot of
> new featurs which will make managers happy but force us to write
> code which is written in an even poorer style of C++.  I don't
> understand how they get away with writing  "ANSI C++ " on
> their box and in their advertisements.
>

Could you be more specific about the problems you see in VC++?

I use VC5 ( not MFC ) and have followed the standard for years.  My
experience has been that although not fully conformant, VC is at least as
close as any alternative.  What are you seeing that I don't?

Regards,
ashley
---
[ 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: kanze@my-dejanews.com
Date: 1998/07/29
Raw View
In article <MPG.10242a896750f29f989687@1.2.3.200>,
  phulakes@DIESPAMDIEbmarket.com (Ashley Fryer) wrote:
> In article <35ba433b.1405020@nntp.interaccess.com>,
> olczyk@interaccess.com says...
> >
> > Not only will they not make it any closer, but they will add a lot of
> > new featurs which will make managers happy but force us to write
> > code which is written in an even poorer style of C++.  I don't
> > understand how they get away with writing  "ANSI C++ " on
> > their box and in their advertisements.
> >
>
> Could you be more specific about the problems you see in VC++?
>
> I use VC5 ( not MFC ) and have followed the standard for years.  My
> experience has been that although not fully conformant, VC is at least as
> close as any alternative.  What are you seeing that I don't?

I suspect the fact that Microsoft does add a lot of additional
"features"
to the standard, and that it is difficult to avoid them if you are
programming in a Windows environment.

Like you, I've found VC++ to be a pretty good compiler, and fairly
close to the standard, BUT... we've only been using it temporarily
to prototype the server, which doesn't use any windowing (other than
through CORBA), and we've been very careful to pay attention to
portability issues, since the final target is an AIX.  Not everyone
is so lucky.

--
James Kanze    +33 (0)1 39 23 84 71    mailto: kanze@gabi-soft.fr
        +49 (0)69 66 45 33 10    mailto: jkanze@otelo.ibmmail.com
GABI Software, 22 rue Jacques-Lemercier, 78000 Versailles, France
Conseils en informatique orient   e objet --
              -- Beratung in objektorientierter Datenverarbeitung

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]
---
[ 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: fvali@biotrack.com
Date: 1998/07/29
Raw View
In article <MPG.10242a896750f29f989687@1.2.3.200>,
  phulakes@DIESPAMDIEbmarket.com (Ashley Fryer) wrote:
>
>
> Could you be more specific about the problems you see in VC++?
>
> I use VC5 ( not MFC ) and have followed the standard for years.  My
> experience has been that although not fully conformant, VC is at least as
> close as any alternative.  What are you seeing that I don't?
>
> Regards,
> ashley
>

Amongst some of the non-conformant issues I have encountered, here is an
example, right from the CD2 draft, regarding partial specialization:

template<class T1, class T2, int I> class A             { }; // #1
template<class T, int I>            class A<T, T*, I>   { }; // #2
template<class T1, class T2, int I> class A<T1*, T2, I> { }; // #3
template<class T>                   class A<int, T*, 5> { }; // #4
template<class T1, class T2, int I> class A<T1, T2*, I> { }; // #5

This does not compile, and produces the following errors:

...DllMain.cpp(224) : error C2989:
'A<`template-parameter-1',`template-parameter-1', ?? >' : template class
has
already been defined as a non-template class ...DllMain.cpp(225) : error
C2989: 'A<`template-parameter-1',`template-parameter-2', ?? >' :
template
class has already been defined as a non-template class
...DllMain.cpp(226) :
error C2989: 'A<int,`template-parameter-1',5>' : template class has
already
been defined as a non-template class ...DllMain.cpp(227) : error C2989:
'A<`template-parameter-1',`template-parameter-2', ?? >' : template class
has
already been defined as a non-template class

Is there some switch that needs to be turned on in VC5++ to get this to
compile properly? -fais


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]
---
[ 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: "Jon Pearson" <pearson@ccdc.cam.ac.uk>
Date: 1998/07/29
Raw View
>Amongst some of the non-conformant issues I have encountered, here is an
>example, right from the CD2 draft, regarding partial specialization:

VC++ doesn't support partial specialization at all.  There are other
deviations from the standard with templates - e.g. template conversion
operators don't work, or see the problem I posted recently about pointers to
template functions.
---
[ 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              ]