This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Putting C++ code into gcc front end
- From: Michael Matz <matz at suse dot de>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: Robert Dewar <dewar at gnat dot com>, <gcc at gcc dot gnu dot org>,<kgardas at objectsecurity dot com>
- Date: Thu, 6 Mar 2003 23:16:08 +0100 (CET)
- Subject: Re: Putting C++ code into gcc front end
Hi,
On 6 Mar 2003, Alexandre Oliva wrote:
> > In particular I would certainly
> > favor a rule forbidding the use of templates,
>
> This would be silly.
To this I agree. templates in it's simpler forms are portable.
> It means you can't use iostreams, since they are templates. You can't
> use strings either. You can't use any of the *very* convenient
> features of the Standard Template Library.
But if the reason is, that we want to use the STL, I would be quite
strongly against that. Using STL anywhere, even the simpler classes, has
a such huge impact on compile time, that it's not funny. If we need a
list or map in the compiler I never would use the STL, and instead write
something simple by hand. All the hooks and possibilities STL provides
make it extremely slow to compile.
> C++ without templates misses a lot of the benefits. C++ without
> templates is kinda sorta a bit like C without pointers :-)
Well, yes. But C++ without STL has only advantages except for throw away
programs, which have to be written fast (like in a programming contest ;-)
)
All IMHO.
Ciao,
Michael.