Skip to content

Commit afe5406

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 aaea1e7 commit afe5406

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
@@ -1116,12 +1116,20 @@ if (distinctFieldNames!(Specs))
11161116
Returns:
11171117
A `size_t` representing the hash of this `Tuple`.
11181118
*/
1119-
size_t toHash() const nothrow @trusted
1119+
size_t toHash()() const nothrow @trusted
11201120
{
1121-
size_t h = 0;
1122-
foreach (i, T; Types)
1123-
h += typeid(T).getHash(cast(const void*)&field[i]);
1124-
return h;
1121+
version(D_BetterC)
1122+
{
1123+
// Disabled in -betterC for now as TypeInfo isn't present
1124+
static assert(0, "Not implemented");
1125+
}
1126+
else
1127+
{
1128+
size_t h = 0;
1129+
foreach (i, T; Types)
1130+
h += typeid(T).getHash(cast(const void*)&field[i]);
1131+
return h;
1132+
}
11251133
}
11261134

11271135
///

0 commit comments

Comments
 (0)