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: Re: istringstream.rdbuf with custom streambuf does not compile

> 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. :>

Best regards,

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