On Friday, 21 August 2015 at 13:11:14 UTC, Iain Buclaw wrote:
If it is guaranteed, almost makes me want to abuse it for this:
pragma(inline, true)
string foo()
{
if (!__ctfe)
assert(false);
// ...
}
(for compilers other than LDC)
That enforces that foo() is always folded at compile time, not
always
inlined, no?
And when you combine both you gets function that is always folded
at compile time and does not bloat the generated object file
(like it happens right now with CTFE-only functions - they are
still emitted to the binary). Win.
Of course, with LDC it is not an issue because they got
--gc-sections working and CTFE utils get garbage collected :P