Properly constrain folly::Function's generic conversion constructor and fix its noexc...
authorEric Niebler <eniebler@fb.com>
Thu, 30 Mar 2017 21:09:32 +0000 (14:09 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 30 Mar 2017 21:18:19 +0000 (14:18 -0700)
commit72ea700cfbbe54c1a3f30d7c9e61a2af9b8a7a1a
tree2d62b13b7017df9566899b9aacd188a0794857b7
parentcc84c39c1c042b20af82b8f54d72a6bf65deb58e
Properly constrain folly::Function's generic conversion constructor and fix its noexcept specification

Summary:
The generic conversion constructor for `folly::Function` was not checking that the source object could successfully be copy/move constructed, leading to some `is_constructible` false positives.

Also, the `noexcept` specification on the `Function` constructor wasn't taking into account that the source object might be copied into the Function, instead of moved. The copy could throw.

Reviewed By: yfeldblum

Differential Revision: D4775037

fbshipit-source-id: f337b41bf9ac431baa9457a501e63c18ca099e57
folly/Function.h
folly/test/FunctionTest.cpp