This is the mail archive of the 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

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?


David Fang

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