July 05, 2004
I thought this the appropriate incantation, but it produces an Access Violation:

    uint hash = typeid(char[]).getHash (myCharArray);

- Kris


July 05, 2004
Put an & in front of myCharArray.

"Kris" <someidiot@earthlink.dot.dot.dot.net> wrote in message news:ccaj0b$7eh$1@digitaldaemon.com...
> I thought this the appropriate incantation, but it produces an Access Violation:
>
>     uint hash = typeid(char[]).getHash (myCharArray);
>
> - Kris
>
>


July 05, 2004
Thank you Walter;

It's non-intuitive, and contrary to typical array=>void * conversion mechanics. But it does work, and that's good enough for me right now <g>

- Kris

"Walter" <newshound@digitalmars.com> wrote in message news:ccc0pk$2ku9$1@digitaldaemon.com...
> Put an & in front of myCharArray.
>
> "Kris" <someidiot@earthlink.dot.dot.dot.net> wrote in message news:ccaj0b$7eh$1@digitaldaemon.com...
> > I thought this the appropriate incantation, but it produces an Access Violation:
> >
> >     uint hash = typeid(char[]).getHash (myCharArray);
> >
> > - Kris
> >
> >
>
>


July 06, 2004
Kris wrote:

> I thought this the appropriate incantation, but it produces an Access
> Violation:
> 
>     uint hash = typeid(char[]).getHash (myCharArray);

And I would've thought this the appropriate incantation:

    uint hash = myCharArray.toHash;

Objects have the toHash property, why not arrays and atomic types?

Stewart.

-- 
My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment.  Please keep replies on the 'group where everyone may benefit.
Top | Discussion index | About this forum | D home