This is the mail archive of the gcc@gcc.gnu.org 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]

Re: ambiguous overload ?


* 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

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