public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zhang Wei Feng <weifeng.zhang@alcatel.be>
To: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: ambiguous overload ?
Date: Wed, 05 Jul 2000 02:19:00 -0000	[thread overview]
Message-ID: <3962FD7D.8FADE7E4@alcatel.be> (raw)

Hi,

I have the following question about overloading the following two functions.

int& Reg(string& name) ;
int Reg(string& name);

The g++ reports that:

CRegisterMap.c: In function `int & Reg(class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)':
CRegisterMap.c:32: new declaration `int & Reg(class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)'
CRegisterMap.c:24: ambiguates old declaration `int Reg(class basic_string<char,string_char_traits<char>,__default_alloc_template<false,0> > &)'

I thought g++ should make the difference between the two functions and will
call the functions correctly based on whether it is used as  lvalue or rvalue, that
is actually my purpose of overloading these two functions in this way!

Any suggestions,

Thanks for your attension!
weifeng

             reply	other threads:[~2000-07-05  2:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-05  2:19 Zhang Wei Feng [this message]
2000-07-05  2:52 ` sidster
2000-07-05  3:27   ` Zhang Wei Feng
2000-07-05  6:54     ` Neil Booth
2000-07-05 13:48       ` Martin v. Loewis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3962FD7D.8FADE7E4@alcatel.be \
    --to=weifeng.zhang@alcatel.be \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).