From 8f10b877ead5e82e5c9a05fc2ed361ab6b08a398 Mon Sep 17 00:00:00 2001 From: monarchdodra Date: Tue, 12 Nov 2013 14:06:13 +0100 Subject: [PATCH] Workaround Issue 11497 - lambda in "static if"/"assert" prevent inlining of function --- std/conv.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/std/conv.d b/std/conv.d index 8bf39952a7f..e3e6c21228d 100644 --- a/std/conv.d +++ b/std/conv.d @@ -3865,7 +3865,8 @@ T* emplace(T, Args...)(T* chunk, auto ref Args args) static assert (is(T* : void*), format("Cannot emplace a %s because it is qualified.", T.stringof)); - static assert(is(typeof({T t = args[0];})), + //static assert(is(typeof({T t = args[0];})), + static assert(is(typeof({T t = lvalueOf!(Args[0]);})), // @@@11497@@@ format("%s cannot be emplaced from a %s.", T.stringof, Arg.stringof)); static if (isStaticArray!T) @@ -3989,7 +3990,8 @@ T* emplace(T, Args...)(T* chunk, auto ref Args args) format("Cannot emplace a %s because it is qualified.", T.stringof)); static if (Args.length == 1 && is(Args[0] : T) && - is (typeof({T t = args[0];})) //Check for legal postblit + //is (typeof({T t = args[0];})) //Check for legal postblit + is (typeof({T t = lvalueOf!(Args[0]);})) // @@@11497@@@ ) { static if (is(T == Unqual!(Args[0])))