"Victor Bazarov" <v.Abazarov@comAcast.net> schrieb im Newsbeitrag
news:f1al1r$m1m$1@news.datemas.de...
Did you include the header where the 'std::min' template is actually
defined? Unless the compiler knows that 'std::min' is a template, it
cannot allow you to specialise it.
Yes, I did. Here's the complete code I am using:
#include <algorithm> // Defines std::min().
#include <cstring> // Defines std::strcmp().
namespace std
{
template <> inline const char*& min<>
( const char*& a, const char*& b )
{
return std::strcmp( a, b ) < 0 ? a : b;
}
}
int main()
{
return 0;
}
I also tried different signatures, like 'const char* min( const char*
a, const char* b )', but those gave me the same error code.
( const char* const& a, const char* const& b) ...