Title
Invalid definition of concept RvalueOf
Status
nad concepts
Section
[concept.transform]
Submitter
Daniel Krügler

Created on 2009-05-28.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In [concept.transform] before p. 4 change as indicated:

auto concept RvalueOf<typename T> {
  typenameRvalueReference type = T&&;
  requires ExplicitlyConvertible<T&, type> && Convertible<T&&, type>SameType<T&, type&>;
}
Date: 2009-05-28.00:00:00

A recent news group article points to several defects in the specification of reference-related concepts.

One problem of the concept RvalueOf as currently defined in [concept.transform]:

concept RvalueOf<typename T> {
 typename type = T&&;
 requires ExplicitlyConvertible<T&,type> && Convertible<T&&,type>;
}

template<typename T> concept_map RvalueOf<T&> {
 typedef T&& type;
}

is that if T is an lvalue-reference, the requirement Convertible<T&&,type> isn't satisfied for lvalue-references, because after reference-collapsing in the concept definition we have Convertible<T&,type> in this case, which isn't satisfied in the concept map template and also is not the right constraint either. I think that the reporter is right that SameType requirements should do the job and that we also should use the new RvalueReference concept to specify a best matching type requirement.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg831
2009-05-28 00:00:00admincreate