If I have code such as:
std::wstring s(L"...");
bool allCharsEqual =
std::find_if(s.begin(),
s.end(),
std::bind1st(std::not_equal_to<std::wstring::value_type>(),
mystring[0])) // ^^^^^^^^^^^^^^^^^^^^^^^^
== s.end();
I would like to have a generic expression in the marked location which would also work if I changed the variable type to std::string
. Is this possible?
I realize I could put this in an extra function and template it with the string type, but is there another way?