
11 Apr
2005
11 Apr
'05
10:56 a.m.
"Peter Dimov" <pdimov@mmltd.net> wrote in message news:003f01c53e6d$14615e50$6501a8c0@pdimov2... | David Abrahams wrote: | > I'm very confused. What is "it" and what "does" it do? | | "It" (overloading on pointer and array) "does" cause ambiguity. | | template<class T> size_t hash_value( T * p ); | template<class T, size_t N> size_t hash_value( T (&a) [N] ); | | int main() | { | int a = { 1, 2, 3 }; | hash_value( a ); | } try #include <cstddef> template<class T> size_t hash_value( const T *& p ); template<class T, size_t N> size_t hash_value( T (&a) [N] ); int main() { int a[] = { 1, 2, 3 }; const int b[] = {1,2,3}; hash_value( a ); hash_value( b ); } -Thorsten