From 4155677482128365427 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,9da47553ab59d368 X-Google-Attributes: gidf78e5,public From: markw65@my-dejanews.com Subject: Re: template member function syntax Date: 1999/02/02 Message-ID: <797hrv$j5d$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 439862425 Approved: Fergus Henderson References: X-Original-Date: Tue, 02 Feb 1999 18:58:13 GMT X-Authentication-Warning: philabs-gw.philabs.research.philips.com: smap set sender to using -f X-Http-User-Agent: Mozilla/4.04 [en] (WinNT; U) X-Complaints-To: news@news.unimelb.edu.au X-Http-Proxy: 1.0 x5.dejanews.com:80 (Squid/1.1.22) for client 207.135.115.70 X-Trace: izvestia.its.unimelb.edu.au 917983100 12212 128.250.29.16 (2 Feb 1999 19:18:20 GMT) Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue Feb 02 18:58:13 1999 GMT X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANrdPZuEDnX0m9pzZAQHzsgF+Iepvzv4l2lF7blRku5WeHBl6doLlEhcd MavmaqVlcEhIx9x5iJJFUbFJA54fpcyC =n0vU NNTP-Posting-Date: 2 Feb 1999 19:18:20 GMT Newsgroups: comp.std.c++ In article , sbnaran@uiuc.edu wrote: > On 02 Feb 99 04:09:35 GMT, hursh wrote: > > > myType mytmp = MyObj.template myFunc(); > > ^^^^^^^^? > > I understand the the syntax error of myType being after the > >less-than operator, but putting the template keyword in the invocation > >just seems plain ugly. > > The 'template' is required to make life easier for the compiler > writer, I think. It seems to me that '>' could not possibly be > interpreted as less-than because you are required to use '&' > when taking the address of a member function. Eg, > > MyObj.myFunc(); > // meaning 1: compare address of MyObj::myfunc with MyType > // meaning 2: call template member function with argument 'MyType' > > But meaning one couldn't possibly be the intended meaning. > Because if wanted meaning one, then we would have to say this, > &MyObj.myfunc < myType; // note the '&' > What about a specialization where myObj has an int data member called myFunc ? Mark Williams -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]