This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Putting C++ code into gcc front end


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]