[Issue 6094] && doesn't shortcut properly with CTFE
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 29 22:06:40 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6094
Rob Jacques <sandford at jhu.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sandford at jhu.edu
Severity|enhancement |regression
--- Comment #8 from Rob Jacques <sandford at jhu.edu> 2011-06-29 22:01:37 PDT ---
I'm pretty sure this is a regression between DMD 2.052 and DMD 2.053. I found
this 'regression' in template constraints:
if( isPointer!T && isPointer!(pointerTarget!T) )
the problem is that if T is a string, then pointerTarget!T can not compile.
This wouldn't be an issue if that meant the template constraint failed
gracefully, but instead it halts compilation.
Anyways, there is the question of whether or not shortcutting is the correct
behavior.
>From a performance point of view, as someone who has spent time optimizing
templates for compile times, anything that can reduce DMD's memory-usage or
compile times is a good thing.
>From a practical point of view, being able to guard statements without using a
static if is great for template constraints and other short templates.
>From a consistently point of view CTFE is already shortcutting everything
inside a if(!__ctfe){} block. (and probably other if(false){} blocks as well).
And we will never be able give up shortcutting if(!__ctfe){} blocks.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list