[PATCH] D17778: TypedError for recoverable error handling

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 17:02:54 PDT 2016

lhames added a comment.

> I think the ErrorHandlerTraits + test cases might be able to be simplified/reduced by implementing some more general and orthogonal constructs. If we had a trait for "arguments to a callable" (as is described here: http://stackoverflow.com/questions/21465394/accept-any-kind-of-callable-and-also-know-argument-type ) and then just used std::result_of, we could probably get away from this code having to worry about members V non-members, etc. Might be able to do the unique_ptr versus ref variants just with overloading & decltype to get the return type... it's a bit hand wavy, I realize, but happy to work through it in more detail if you like.

I think factoring out the argument-matching stuff into a general callable_traits class would be useful, and I'm happy to do it, . I need to do something like that anyway for some improvements I want to make to the RPC API. That said, I think we can do that post commit - I want to take some time to think about the right way to do it, and I don't want to block the people who are waiting for this Error support to land.


More information about the llvm-commits mailing list