Why this code can't take advantage from CTFE?

Marc Schütz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 3 09:49:39 PST 2016


On Wednesday, 3 February 2016 at 16:07:59 UTC, Messenger wrote:
> What is a good way to try to force it? Using enum? Then 
> optionally copying the value once to avoid the "manifest 
> constant" copy/paste behaviour, where applicable?

template forceCTFE(alias expr) {
     alias forceCTFE = expr;
}

auto value = forceCTFE!(some_expression());


More information about the Digitalmars-d-learn mailing list