Created on 2019-11-04.00:00:00 last changed 62 months ago
Proposed resolution:
This wording is relative to N4835.
Modify [basic.string] p3, class template basic_string synopsis, as indicated:
template<class T> constexpr basic_string& operator=(charT c);
Modify [string.cons] as indicated:
template<class T> constexpr basic_string& operator=(charT c);-?- Constraints: is_same_v<T, charT> is true.
-30- Effects: Equivalent to:return *this = basic_string_view<charT, traits>(addressof(c), 1);
[ 2019-11 Status to Duplicate during Tuesday morning issue processing in Belfast. ]
Duplicate of 2372.
Addresses RU 013
Because of the implicit conversion of arithmetic types it is error prone to use the basic_string::operator=(charT c):
double d = 3.14; std::string s; s = d; // Compiles
Make sure that the program is ill-formed if an implicit conversion from arithmetic type happens while assigning to std::basic_string. Or at least make sure that the program is ill-formed if an implicit conversion from floating point type happens while assigning to std::basic_string.
History | |||
---|---|---|---|
Date | User | Action | Args |
2019-11-07 08:20:25 | admin | set | messages: + msg10784 |
2019-11-07 08:20:25 | admin | set | status: new -> dup |
2019-11-04 19:01:12 | admin | set | messages: + msg10735 |
2019-11-04 00:00:00 | admin | create |