This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: cin/cout as reference objects [Re: AIX I/O failures]
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: cin/cout as reference objects [Re: AIX I/O failures]
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 26 Jan 2001 07:53:14 +0100
- Cc: rth at redhat dot com, libstdc++ at sources dot redhat dot com
- Organization: CodeSourcery, LLC
- References: <20010125184729.A1844@redhat.com> <20010125190650S.mitchell@codesourcery.com>
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