c++ - There seems to be a contradiction in §12.3.2/1 in the C++11 Standard -
c++11 standard §12.3.2/1 (emphasis mine):
a member function of class x having no parameters name of form
conversion-function-id:
operator conversion-type-id
conversion-type-id:
type-specifier-seq conversion-declarator
conversion-declarator:
ptr-operator conversion-declarator
specifies conversion x type specified conversion-type-id. such functions called conversion functions. no return type can specified. if conversion function member function, type of conversion function (8.3.5) “function taking no parameter returning conversion-type-id”.
is conversion function member function, or there cases not true?
the clause "if conversion function member function," added working draft in n2798 part of concepts wording per n2773 proposed wording concepts. n2798 12.3.2/1 reads (i'll use bold show additions, , strikeout show removals):
1 member function of class
x
having no parameters, or associated function of concept sole parameter of typex
, name of formconversion-function-id:
operator
conversion-type-idconversion-type-id:
type-specifier-seq attribute-specifieropt conversion-declaratoropt
conversion-declarator:
ptr-operator conversion-declaratoropt
specifies conversion
x
type specified conversion-type-id. suchmemberfunctions called conversion functions.classes, enumerations, , typedef-names shall not declared in type-specifier-seq. neither parameter types norno return type can specified. if conversion function member function, tthe type ofathe conversion function (8.3.5) “function taking no parameter returning conversion-type-id”; if conversion function associated function, type of conversion function “function taking parameter of typex
returning conversion-type-id”. conversion function never used convert ...
the concepts wording removed in draft n2960. "if conversion function member function," should have been removed @ time since vestigal. pertinent portion of n2960 §12.3.2/1:
1 member function of class
x
having no parameters,or associated function of concept sole parameter of type x,name of formconversion-function-id:
operator
conversion-type-idconversion-type-id:
type-specifier-seq attribute-specifieropt conversion-declaratoropt
conversion-declarator:
ptr-operator conversion-declaratoropt
specifies conversion
x
type specified conversion-type-id. such functions called conversion functions. no return type can specified. if conversion function member function, type of conversion function (8.3.5) “function taking no parameter returning conversion-type-id”; if conversion function associated function, type of conversion function “function taking parameter of type. ...x
returning conversion-type-id”
Comments
Post a Comment