Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-04-11 05:56:08


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:003f01c53e6d$14615e50$6501a8c0_at_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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk