Skip to content

Commit 67f1edc

Browse files
committed
Disabled toHash in -betterC for now
TypeInfo is part of DRuntime. See: #5952 Replaced `toHash` with a parameter-less template for codegen on demand.
1 parent ad8e39d commit 67f1edc

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

std/typecons.d

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,12 +1135,20 @@ if (distinctFieldNames!(Specs))
11351135
Returns:
11361136
A `size_t` representing the hash of this `Tuple`.
11371137
*/
1138-
size_t toHash() const nothrow @trusted
1138+
size_t toHash()() const nothrow @trusted
11391139
{
1140-
size_t h = 0;
1141-
foreach (i, T; Types)
1142-
h += typeid(T).getHash(cast(const void*)&field[i]);
1143-
return h;
1140+
version(D_BetterC)
1141+
{
1142+
// Disabled in -betterC for now as TypeInfo isn't present
1143+
static assert (0, "Not implemented");
1144+
}
1145+
else
1146+
{
1147+
size_t h = 0;
1148+
foreach (i, T; Types)
1149+
h += typeid(T).getHash(cast(const void*)&field[i]);
1150+
return h;
1151+
}
11441152
}
11451153

11461154
///

0 commit comments

Comments
 (0)