This is the mail archive of the
mailing list for the GCC project.
Re: Re: istringstream.rdbuf with custom streambuf does not compile
- From: "lh_mouse"<lh_mouse at 126 dot com>
- To: "gcc-help"<gcc-help at gcc dot gnu dot org>
- Date: Fri, 6 May 2016 22:22:21 +0800
- Subject: Re: Re: istringstream.rdbuf with custom streambuf does not compile
- Authentication-results: sourceware.org; auth=none
- References: <4c30a34b dot e913 dot 1548614fdb5 dot Coremail dot ssawgift at 163 dot com> <b1bd632 dot 10f324 dot 15486294330 dot Coremail dot lh_mouse at 126 dot com><5aa4f50a-39cd-ae4b-f722-c0d646f67c0f at 163 dot com>
> But, I am not quite confident about the above reasoning. Am I wrong or not?
ISO/IEC WG21 (Working Draft, Standard for Programming Language C++) N4582:
10.2 Member name lookup [class.member.lookup]
4 If C contains a declaration of the name f, the declaration set contains every declaration of f declared in C
that satisfies the requirements of the language construct in which the lookup occurs. [ Note:
(... omitted ...) âend note ] If the resulting declaration set is not empty, the subobject set contains C itself,
and calculation is complete.
The name lookup stops as soon as the compiler finds 'basic_stringbuf<charT,traits,Allocator>* rdbuf() const' of basic_istringstream.
This is commonly known as 'name hiding'. The name 'rdbuf' of ios_base is effectively hidden by that of basic_istringstream.
Your question is about C++ itself rather than GCC so I don't think they belong here. :>