-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
C++17's ambiguous conversion #586
Copy link
Copy link
Closed
Labels
confirmedkind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Milestone
Description
Metadata
Metadata
Assignees
Labels
confirmedkind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
In c++ 17, std::string_view can be converted to std::string implicitly which leads to a problem that in c++17 mode , a json object cannot be assigned to a string due to ambiguous assigning conversion path ( json --> string and json --> string_view --> string).
In gcc 7.1 such code produces a compilation error width -std=c++1z.
code:
So, is it possible to remove the conversion to string specifically in c++17 mode to let the compiler select the json--> string_view --> string path ?