Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | "Richard Smith"<richard@metafoo.co.uk> |
|---|---|
| Newsgroups | comp.std.c++ |
| Subject | Defect report: ref-qualifiers in partial ordering of non-static template operator members and non-members |
| Date | 2011-10-19 15:24 -0700 |
| Organization | unknown |
| Message-ID | <36286.10.0.16.53.1319061850.squirrel@webmail.secure.aluminati.net> (permalink) |
Hi, C++11 [temp.func.order]p3 says: "If only one of the function templates is a non-static member, that function template is considered to have a new first parameter inserted in its function parameter list. The new parameter is of type “reference to cv A,” where cv are the cv-qualifiers of the function template (if any) and A is the class of which the function template is a member. [ Note: This allows a non-static member to be ordered with respect to a nonmember function and for the results to be equivalent to the ordering of two equivalent nonmembers. — end note ]" This paragraph does not specify what kind of reference the new parameter should be (and I can't see anywhere else in the standard which specifies this). It seems to me that the standard should specify that the new parameter shall be an rvalue reference if the non-static member function template uses the&& ref-qualifier, and an lvalue reference otherwise. Thanks, Richard -- [ comp.std.c++ is moderated. To submit articles, try posting with your ] [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to comp.std.c++ | Previous | Next | Find similar
Defect report: ref-qualifiers in partial ordering of non-static template operator members and non-members "Richard Smith"<richard@metafoo.co.uk> - 2011-10-19 15:24 -0700
csiph-web