update open discussion
This commit is contained in:
parent
6452aadcbe
commit
9184792fc3
16
P0959.md
16
P0959.md
@ -825,9 +825,21 @@ auto id1 = uuid::from_string("47183823-2574-4bfd-b411-99ed177d3e43"); // [1]
|
||||
std::string str{ "47183823-2574-4bfd-b411-99ed177d3e43" };
|
||||
auto id2 = uuid::from_string(str); // [2]
|
||||
```
|
||||
Because there is no implicit conversion from `std::basic_string` to `std::basic_string_view`, [2] would not work. Instead, it should be:
|
||||
Because template argument deduction does not work, both [1] and [2] would produce compiler errors. Instead, it should be one of the following, neither being desirable.
|
||||
```cpp
|
||||
auto id2 = uuid::from_string(std::string_view {str});
|
||||
auto id1 = uuid::from_string(
|
||||
std::string_view {"47183823-2574-4bfd-b411-99ed177d3e43"}); // [1]
|
||||
|
||||
std::string str{ "47183823-2574-4bfd-b411-99ed177d3e43" };
|
||||
auto id2 = uuid::from_string(std::string_view {str}); // [2]
|
||||
```
|
||||
or
|
||||
```cpp
|
||||
auto id1 = uuid::from_string<char, std::char_traits<char>>(
|
||||
"47183823-2574-4bfd-b411-99ed177d3e43"); // [1]
|
||||
|
||||
std::string str{ "47183823-2574-4bfd-b411-99ed177d3e43" };
|
||||
auto id2 = uuid::from_string<char, std::char_traits<char>>(str); // [2]
|
||||
```
|
||||
|
||||
#### Need more explanations about the choices of ordering and how the RFC works in that regard.
|
||||
|
Loading…
Reference in New Issue
Block a user