public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* ambiguous overload ?
@ 2000-07-05  2:19 Zhang Wei Feng
  2000-07-05  2:52 ` sidster
  0 siblings, 1 reply; 5+ messages in thread
From: Zhang Wei Feng @ 2000-07-05  2:19 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-07-05 13:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-05  2:19 ambiguous overload ? Zhang Wei Feng
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

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