This is the mail archive of the
mailing list for the GCC project.
Re: Using C++ in GCC is OK
- From: David Fang <fang at csl dot cornell dot edu>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Mon, 31 May 2010 11:29:57 -0400 (EDT)
- Subject: Re: Using C++ in GCC is OK
- References: <4C030228.firstname.lastname@example.org>
For example, I think it goes without question that at this point we are
limiting ourselves to C++98 (plus "long long" so that we have a 64-bit
integer type); C++0x features should not be used. Using multiple
inheritance, templates (other than when using the C++ standard library,
e.g. std::list<X>), or exceptions also seems overly aggressive to me.
We should use features that are relatively easy for C programmers to
understand and relatively hard for new C++ programmers to misuse. (For
example, I think constructors and destructors are pretty easy and hard
This sort of leads to questions about C++ libraries used by gcc:
1) is there interest in using libstdc++ (gcc's version) in whole or a
subset? (which subset?) For example, I think it would be reasonable to
use most standard containers. <algorithm> could be useful, but itself
relies on function overloading for optimization in some places.
Overloading in any form could be debatable, if you're being conservative
about feature selection.
2) should there be a double standard w.r.t. std library use? Allowing a
greater set of language features for the sake of using libstdc++, but a
restricted set of C++ for non-libstdc++ libraries and data structures?
iostreams, for example, uses multiple inheritance (even multiple virtual
inheritance), should that be sufficient grounds for forbidding use of