[Solved] how to code “hello” == obj without overload the operator==? [closed]
Issue with: template <typename T> bool operator== (const String<T>& a, const String<T>& b ) is the deduction of T, and for “hello” == String<char>(“hello”), “hello” doesn’t match const String<T>&, so that overload is discarded. What you can do is to make it non template: template <typename T> class String { // non template function. friend … Read more