exception_wrapper: now without undefined behavior
authorTudor Bosman <tudorb@fb.com>
Fri, 2 May 2014 02:57:06 +0000 (19:57 -0700)
committerDave Watson <davejwatson@fb.com>
Tue, 20 May 2014 19:53:57 +0000 (12:53 -0700)
commit460653084492f23388742905ebb884fc673eaabc
tree6b499dc4aaab403be4eeecb08b7eed81b0e2ffc7
parent7fda1f29212ba8402e8b43c08e1c66dd1e8e7c95
exception_wrapper: now without undefined behavior

Summary:
Converting from std::exception* to void* to T* (where T is not std::exception
but a derived type) is undefined behavior (and will break with multiple or
virtual inheritance). Luckily, there's no need for void* there at all.

Also, don't force make_exception_wrapper to capture by value.

Test Plan: exception_wrapper_test

Reviewed By: marccelani@fb.com

FB internal diff: D1308251

@override-unit-failures
folly/ExceptionWrapper.h
folly/detail/ExceptionWrapper.h
folly/test/ExceptionWrapperTest.cpp