Extending Ensure for non Templates

  1. Starting with the easy question: Yes it is intentional that hand-written HasEnsure instances don’t work. The same is true for a lot of other Has* classes. We use those internally in the compiler to translate templates.

For 2 and 3, see Should runtime/API respect namespace scopes? for some related discussion. I think you can make this work but it needs a whole bunch of changes across the stack.

1 Like