C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Possible typo in C++98

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Ivan A. Kosarev
Guest





PostPosted: Thu Sep 22, 2005 5:23 am    Post subject: Possible typo in C++98 Reply with quote



Hello,

C++98 13.5.4 #1 says: "...Thus, a call x(arg1,...) is interpreted as
x.operator()(arg1,...) for a class object x of type T if T::operator()(T1,
T2, T3) exists and if the operator is selected as the best match
function...".

Can anybody clear whether something like "...if T::operator()(T1, ...)
exists..." actually should be there, and thus is it just a kind of typo in
the Standard? If not, what the T1, T2 and T3 types should mean there?

Thank you.

--
Unicals Group -- Development Tools for OEMs
http://www.unicals.com


---
[ 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://www.jamesd.demon.co.uk/csc/faq.html ]

Back to top
Victor Bazarov
Guest





PostPosted: Thu Sep 22, 2005 6:31 pm    Post subject: Re: Possible typo in C++98 Reply with quote



Ivan A. Kosarev wrote:
Quote:
C++98 13.5.4 #1 says: "...Thus, a call x(arg1,...) is interpreted as
x.operator()(arg1,...) for a class object x of type T if T::operator()(T1,
T2, T3) exists and if the operator is selected as the best match
function...".

Can anybody clear whether something like "...if T::operator()(T1, ...)
exists..." actually should be there, and thus is it just a kind of typo in
the Standard? If not, what the T1, T2 and T3 types should mean there?

I think whoever wrote it wanted to avoid the interpretation of the example
declaration (the proposed by you "T::operator()(T1, ...)") *literally*, in
other words, as having the _ellipsis_ in the argument list. While those
dots in the text "a call x(arg1,...) is interpreted" cannot be part of the
syntax and therefore cannot be misinterpreted, the ellipsis in the other
part can, and therefore would have to be supplied with a note that those
dots do not mean the same thing as "ellipsis" usually means.

I do not think your alternative is an improvement, but I don't have my own
to propose.

V

---
[ 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://www.jamesd.demon.co.uk/csc/faq.html ]


Back to top
Alberto Ganesh Barbati
Guest





PostPosted: Fri Sep 23, 2005 1:35 pm    Post subject: Re: Possible typo in C++98 Reply with quote



Ivan A. Kosarev wrote:
Quote:
Hello,

C++98 13.5.4 #1 says: "...Thus, a call x(arg1,...) is interpreted as
x.operator()(arg1,...) for a class object x of type T if T::operator()(T1,
T2, T3) exists and if the operator is selected as the best match
function...".

Can anybody clear whether something like "...if T::operator()(T1, ...)
exists..." actually should be there, and thus is it just a kind of typo in
the Standard? If not, what the T1, T2 and T3 types should mean there?


I agree that it's very confusing. Moreover, writing "x(arg1,...)" is
also misleading, as it's clearly stated that the expression-list can be
empty. Taking also into account Victor Bazarov's remark about the
ambiguity of ellipsis, I would rewrite the entire sentence like this:

"...Thus, a call x(...) is interpreted as x.operator()(...) for a class
object x of type T if there is a T::operator() with a matching number of
parameters and if such operator is selected as the best match function...".

Ganesh

---
[ 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://www.jamesd.demon.co.uk/csc/faq.html ]


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.