Thread overview
I need a @nogc version of hashOf(). What are the options?
Aug 07, 2016
Gary Willoughby
Aug 07, 2016
Ilya Yaroshenko
Aug 07, 2016
ag0aep6g
Aug 07, 2016
ag0aep6g
Aug 07, 2016
Gary Willoughby
August 07, 2016
I need a @nogc version of hashOf(). Here's one i'm currently using but it's not marked as @nogc.

https://github.com/dlang/druntime/blob/master/src/object.d#L3170

What are the options now?

Is there anything D offers that I could use? I need a function that takes a variable of any type and returns a numeric hash.
August 07, 2016
On Sunday, 7 August 2016 at 16:42:47 UTC, Gary Willoughby wrote:
> I need a @nogc version of hashOf(). Here's one i'm currently using but it's not marked as @nogc.
>
> https://github.com/dlang/druntime/blob/master/src/object.d#L3170
>
> What are the options now?
>
> Is there anything D offers that I could use? I need a function that takes a variable of any type and returns a numeric hash.

Current DMD master has MurmurHash3 digest.
August 07, 2016
On 08/07/2016 06:42 PM, Gary Willoughby wrote:
> I need a @nogc version of hashOf(). Here's one i'm currently using but
> it's not marked as @nogc.
>
> https://github.com/dlang/druntime/blob/master/src/object.d#L3170

That seems to be an oversight.

https://github.com/dlang/druntime/pull/1624
August 07, 2016
On 08/07/2016 07:10 PM, ag0aep6g wrote:
> https://github.com/dlang/druntime/pull/1624

Has been merged. Is going to be part of 2.072.
August 07, 2016
On Sunday, 7 August 2016 at 18:37:19 UTC, ag0aep6g wrote:
> On 08/07/2016 07:10 PM, ag0aep6g wrote:
>> https://github.com/dlang/druntime/pull/1624
>
> Has been merged. Is going to be part of 2.072.

Very cool!

MurmurHash3 is a great addition too. Thanks guys.