Skip to content

Commit

Permalink
Disabled toHash in -betterC for now
Browse files Browse the repository at this point in the history
TypeInfo is part of DRuntime.
See: dlang#5952

Replaced `toHash` with a parameter-less template for codegen on demand.
  • Loading branch information
wilzbach committed Dec 22, 2017
1 parent ad8e39d commit 67f1edc
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions std/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -1135,12 +1135,20 @@ if (distinctFieldNames!(Specs))
Returns:
A `size_t` representing the hash of this `Tuple`.
*/
size_t toHash() const nothrow @trusted
size_t toHash()() const nothrow @trusted
{
size_t h = 0;
foreach (i, T; Types)
h += typeid(T).getHash(cast(const void*)&field[i]);
return h;
version(D_BetterC)
{
// Disabled in -betterC for now as TypeInfo isn't present
static assert (0, "Not implemented");
}
else
{
size_t h = 0;
foreach (i, T; Types)
h += typeid(T).getHash(cast(const void*)&field[i]);
return h;
}
}

///
Expand Down

0 comments on commit 67f1edc

Please sign in to comment.