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] |
Mark Mitchell <mark@codesourcery.com> writes:
[snip stuff addressed elsewhere]
I agree with the goal of more hiding.
You can do this in C by using an incomplete structure type in most places, and then, in the files where you want the definition visible, defining the structure to have a single field of the enumerated type. That is a little messy, but it is C++-compatible. (In fact, in ISO C++, without the additions presently in the WP, you can't do better; forward declarations of enums are still not allowed.)
Doesn't work, at least not as a drop-in replacement; you can't pass an incomplete structure by value. We do do this in places where there's a real structure that can be passed around by pointer...
-- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com (916) 791-8304
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |