std::string class inheritance and tedious c++ overload resolution
问题 I need to extend std::basic_string to work over path strings and different operator+ : #include <string> template <class t_elem, class t_traits, class t_alloc> class path_basic_string : public std::basic_string<t_elem, t_traits, t_alloc> { public: using base_type = std::basic_string<t_elem, t_traits, t_alloc>; path_basic_string() = default; path_basic_string(const path_basic_string & ) = default; path_basic_string & operator =(const path_basic_string &) = default; path_basic_string(const base