It's still trivial to do this without allowing arbitrary expressions, since the expressions have to be CTFE-able. enum constIsEnabled = isConst!(_wrapped.front); auto front() const(constIsEnabled) { return _wrapped.front; }