On Wednesday, 5 April 2017 at 16:06:39 UTC, H. S. Teoh wrote:
On Wed, Apr 05, 2017 at 11:20:28AM +0000, Yuxuan Shui via
Digitalmars-d wrote:
[...]
Did you read the entire article?
There is an entire section dedicated to interleaving of CTFE
and templates. And no, you still cannot run CTFE on the same
part of the AST that is being template-expanded. But you *can*
run CTFE on a subtree that has already been fully expanded.
And no, the forum post you linked to has nothing to do with
CTFE. The
so-called "static foreach" is unrolled at AST expansion time,
and is not
run through CTFE at all (unless later on you call the expanded
function at "compile-time"). And is() expressions are also not
CTFE,
they are also evaluated at AST expansion time.
Read the entire article first. ;-)
T
I was talking about the use of R.front, R.drop in the template.