Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to reuse a friend operator?

Reply
Thread Tools

How to reuse a friend operator?

 
 
Victor Bazarov
Guest
Posts: n/a
 
      07-24-2004
"Piotr Wyderski" <(E-Mail Removed)> wrote...
>
> Victor Bazarov wrote:
>
> > As I read it, the Standard, 3.4.3/2, the last part of it, says that
> > if during an ordinary unqualified name lookup a _member_ is found,
> > then the associated namespaces namespaces and classes are not

considered.
>
> I'll look closer at that chapter.
>
> > So, it is standard behaviour, there are work-arounds, do you want me to
> > help you with them or do you already know them?

>
> Well, of course, please describe the workarounds you know, maybe
> something would be new to me. However, the question is not how to


If it not, then I won't bother.

> fix it, becaue the most standard-conforming workaround is to move
> friends outside the class. The question is how to do it using internal
> friends, because:
>
> a) the C++ standard allows internal friends;
> b) it seems to be impossible to call one of them from another.


That's not necessarily true. The thing is that the member operator+
_interferes_ with name lookup of the friend.

>
> If the above statement is true, then there is an imperfection
> in the name lookup algorithm and it should be fixed.


Try describing the problem in comp.std.c++, and possibly suggest the
fix after studying the current behaviour in more detail.

Victor


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
To reuse or not to reuse jacob navia C Programming 19 12-18-2006 07:22 AM
code reuse and design reuse sailor.gu@gmail.com C Programming 16 02-12-2006 09:09 PM
Reuse paramter list and reuse connection tshad ASP .Net 5 05-17-2005 12:33 AM
To reuse or not to reuse.... Hylander Java 0 02-26-2004 12:00 AM



Advertisments