
16 Aug
2012
16 Aug
'12
1:38 p.m.
Using unused virtual functions to defer instantiation traps is incredibly clever... If my understanding is correct :)
The technique also works if the what() function is replaced with a non-virtual destructor. So I don't think "virtual" is the magic ingredient here.
Shoot. That sounded like such a reasonable explanation, too.
Couldn't you avoid generating the error in sfinae_error and instead static_assert that a given function call doesn't have a sfinae_error return type?
You could (that's basically how Origin's concept checking stuff works), but you'd still have the problem that every expression in the constrained template will still be instantiated and type-checked so you'll get errors.