This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: cin/cout as reference objects [Re: AIX I/O failures]


Mark Mitchell <mark@codesourcery.com> writes:

| >>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:
| 
|     Richard> You should therefore be *extremely* cautious in exporting
|     Richard> anything from a shared library that isn't a function or a
|     Richard> built-in type such as a pointer.
| 
| Thanks for the detailed analysis.  That's very interesting.
| 
| What you say, though, applies to the *original* approach as well, so
| we're no better off than we were then, if I understand correctly.
| (Because all I did was change the *type* of an aggregate, not its
| existence.)
| 
| So, you're information argues in favor of Gaby's proposal -- the
| indirection protects you against changes in the sizes of the object,
| from the ABI point of view.
| 
| But, that doesn't really do any good, because there are inline
| functions on ostreams anyhow, and because users can say `sizeof
| (cout)' in their programs, and if the library implementors change the

If they say sizeof(cout), they will get sizeof(ostream).  Why is that
incorrect ?

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com

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