This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ambiguous overload ?
- To: Zhang Wei Feng <weifeng dot zhang at alcatel dot be>
- Subject: Re: ambiguous overload ?
- From: sidster <patrick at mail dot boxsoft dot com>
- Date: Wed, 5 Jul 2000 02:51:55 -0700
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- References: <3962FD7D.8FADE7E4@alcatel.be>
* Zhang Wei Feng (weifeng.zhang@alcatel.be) [20000705 02:39]:
>
> I have the following question about overloading the following two functions.
>
> int& Reg(string& name) ;
> int Reg(string& name);
"Function that only differ in return type may not have the same name."
('The C++ Programming Language - 2nd Edition' B. Stroustrup p.586)
You can't overload function in C++ the way you want to.
patrick
--
Life is a waste of time, time is a waste of life, so get
wasted all of the time and have the time of your life.
-- Michelle Mastrolacasa