From 67f1edc8dae1c2f1ca1316ce675d3354971bfc64 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Fri, 22 Dec 2017 12:33:06 +0100 Subject: [PATCH] Disabled toHash in -betterC for now TypeInfo is part of DRuntime. See: https://github.com/dlang/phobos/pull/5952 Replaced `toHash` with a parameter-less template for codegen on demand. --- std/typecons.d | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/std/typecons.d b/std/typecons.d index a1b2e160941..3cf90e84937 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -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; + } } ///