const string& s = max<string>("a", "b");
cout << s;
Standard types and functions, const references, no warnings, everything by the book. But it crashes.There's a similar can of worms related to slicing (treating Derived* as Base* is silently unsafe because arrays and copy constructors exist). C++ is scary.