Topic: RFD: C++ Compiler/Library Conformance


Author: Garth_Dickie@avid.com
Date: 2000/06/18
Raw View

Herb Sutter wrote:
>   What compiler/library conformance weaknesses matter to you in
>   real-world production code?

I have two favorites:


1. New-style header names, with the standard library in namespace std.

When I write code which is intended to be portable between compilers,
and I want to use the C++ standard library, I would like to use the new
style header names. This is particularly important for <iostream> and
<sstream>, where the old header names provide different functionality.

When I have to deal with a mixture of behavior in the compilers, I end
up with a mess of #ifdef stuff, and no namespaces:

#if defined( NO_SSTREAM_SUPPORT)
    #include <strstream.h>
#else
    #include <sstream>
#endif


2. Non-inline template definitions.

I want to have the linker instantiate templates. This is the only way to
break #include dependencies. The code which makes use of a template
should not have to include all of the interfaces used by the
implementation of the template.

Of the compilers with which I have experience, SGI's compiler has done
this for a long time, while the Metrowerks and MSVC++ compilers do not.


Regards,
Garth

---
[ 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              ]