
On 5/21/07, Eric Niebler <eric@boost-consulting.com> wrote:
Daniel Walker wrote:
Incidentally, we do know how to test for member templates now. Here's a thread archive discussing my patch to MPL that does this: http://tinyurl.com/2os8fl.
So, it would be possible to implement a result_of that deduces the correct return type in corner cases like your example without decltype. But decltype is a much better all around solution.
Can you comment on why some of your tests fail with Comeau? I haven't looked into your patch, but if it doesn't work with Comeau, there's a good chance it's non-standard, which would be a deal-breaker for tr1::result_of.
I've been in touch with the Comeau folks, and they determined that the Comeau behavior that causes some tests to fail is non-standard. I believe they're working on fixing it for an upcoming release. So, Comeau will eventually pass all tests. Actually, this was a couple of months ago, and they may already have it fixed. I haven't gone back to check. But again, rather than changing the heuristic in TR1 to include a check for a result<> member, I prefer the recent amendment, which removes section 3.4/3 entirely since implementers can just use decltype. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2194.pdf Daniel