Using C++ in GCC is OK

David Fang fang@csl.cornell.edu
Mon May 31 15:40:00 GMT 2010


> 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
> to misuse.)

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 
iostreams?

Fang

David Fang
http://www.csl.cornell.edu/~fang/
http://www.achronix.com/



More information about the Gcc mailing list