
13 Aug
2012
13 Aug
'12
7:46 a.m.
Right. It can be easily turned into a compile-time error by static_assert'ing that the function's return type is not sfinae_error, but the compiler error wouldn't be informative. You'd have to run to code to see the error.
I was hoping to have a way to transport the error to an API boundary and reporting it there, instead of presenting users with an imposing template instantiation backtrace, but that might not be possible.
I haven't followed this discussion, but you can move static_assert's up the call stack by moving the condition into an enable/disable_if, then the compiler simply doesn't find the function and you get the error "sooner". But you've probably considered all this already yours, John.