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: Using C++ in GCC is OK


On Wed, Jun 2, 2010 at 2:44 AM, Paolo Bonzini <bonzini@gnu.org> wrote:

> In particular, I wonder if the best use of C++ wouldn't be a set of
> functions (including templates, etc.) implementing a kind of RTTI with a
> less verbose syntax than what we have now.

Agreed.  I don't agree with the rejection of simple function templates
and class templates.  Many macro-games we currently play, are good
candidates as you shown in your message.  Furthermore, many of the
casts are there because C does not give us  'generic type macros' that
scale.

In the guidelines, I would like to include:
   (1) cast should be minimized
   (2) if you define a class template used mostly with pointer type arguments,
        consider specializing for void* (or const void*) and define all other
        pointer specialization in terms of that.


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