Date
2010-02-03.00:00:00
Message id
1543

Content

Table 33 — MoveConstructible requirements [moveconstructible] and Table 34 — CopyConstructible requirements [copyconstructible] support solely the following expression:

T t(rv)

where rv is defined to be as "non-const rvalue of type T" and t as a "modifiable lvalue of type T" in [utility.arg.requirements]/1.

This causes two different defects:

  1. We cannot move/copy-initialize a const lvalue of type T as in:

    int get_i();
    
    const int i1(get_i());
    

    both in Table 33 and in Table 34.

  2. The single support for

    T t(rv)
    

    in case of CopyConstructible means that we cannot provide an lvalue as a source of a copy as in

    const int& get_lri();
    
    int i2(get_lri());
    

I believe this second defect is due to the fact that this single expression supported both initialization situations according to the old (implicit) lvalue reference -> rvalue reference conversion rules.

Finally [copyconstructible] refers to some name u which is not part of the expression, and both [copyconstructible] and [moveconstructible] should support construction expressions from temporaries - this would be a stylistic consequence in the light of the new DefaultConstructible requirements and compared with existing requirements (see e.g. Container requirements or the output/forward iterator requirements)..