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: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: gcc at gcc dot gnu dot org, kgardas at objectsecurity dot com
- Date: 06 Mar 2003 08:04:55 +0100
- Subject: Re: Putting C++ code into gcc front end
- Organization: Integrable Solutions
- References: <20030305224212.E6A69F2DD7@nile.gnat.com>
dewar at gnat dot com (Robert Dewar) writes:
| > First five points on this list look quite restrictive
|
| Well "quite restrictive" is not necessarily a bad thing. In
| particular I would certainly
| favor a rule forbidding the use of templates, because the use of
| templates can so easily
| get out of hand.
The same may be said for virtually everything else in C.
However, yes, some advanced template constructs need better compilers.
But that does not mean that every template construct is advanced.
No. That does not reflect reality.
Certainly, I don't want to implement the same data structure in C++
each time the contained objet type changes.
template<class T>
struct list {
list<T>* previous;
list<T>* next;
T data;
};
will work even with GCC-2.7.x. It is -not- an advanced construct.
It has been in ARM C++.
| Perhaps someone who knows C++ better than I do can
| formulate rules to prevent misuse of templates,
Matt gave some thoughts on that issue.
Anyway, this is completely orthogonal to Tom's request.
-- Gaby