diff --git a/P0959.md b/P0959.md index 86b8d11..a1c0c42 100644 --- a/P0959.md +++ b/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>( + "47183823-2574-4bfd-b411-99ed177d3e43"); // [1] + +std::string str{ "47183823-2574-4bfd-b411-99ed177d3e43" }; +auto id2 = uuid::from_string>(str); // [2] ``` #### Need more explanations about the choices of ordering and how the RFC works in that regard.