Answer by BoP for Why doesn't std::string have a constructor that directly...
The ambiguity is that std::string and std::string_view are both constructible from const char *. That makes things likestd::string{}.assign("ABCDE", 0, 1)ambiguous if the first parameter can be either...
View ArticleWhy doesn't std::string have a constructor that directly takes std::string_view?
To allow std::string construction from std::string_viewthere is a template constructortemplate<class T>explicit basic_string(const T& t, const Allocator& alloc = Allocator());which is...
View Article
More Pages to Explore .....