Re: Explicitly specializing std::min() on VC++ 2005 Express Edition
- From: "Matthias Hofmann" <hofmann@xxxxxxxxxxxxxx>
- Date: Wed, 2 May 2007 21:21:53 +0200
"Victor Bazarov" <v.Abazarov@xxxxxxxxxxxx> schrieb im Newsbeitrag
news:f1al1r$m1m$1@xxxxxxxxxxxxxxxxxx
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.
--
Matthias Hofmann
Anvil-Soft, CEO
http://www.anvil-soft.com - The Creators of Toilet Tycoon
http://www.anvil-soft.de - Die Macher des Klomanagers
.
- Follow-Ups:
- Re: Explicitly specializing std::min() on VC++ 2005 Express Edition
- From: Victor Bazarov
- Re: Explicitly specializing std::min() on VC++ 2005 Express Edition
- References:
- Explicitly specializing std::min() on VC++ 2005 Express Edition
- From: Matthias Hofmann
- Re: Explicitly specializing std::min() on VC++ 2005 Express Edition
- From: Victor Bazarov
- Explicitly specializing std::min() on VC++ 2005 Express Edition
- Prev by Date: Re: MAKEINTRESOURCE
- Next by Date: Re: First chance exceptions and try-catch block...
- Previous by thread: Re: Explicitly specializing std::min() on VC++ 2005 Express Edition
- Next by thread: Re: Explicitly specializing std::min() on VC++ 2005 Express Edition
- Index(es):
Relevant Pages
|