make FunctionRef constexpr on compilers that support it
Summary: `constexpr` All The Things! Although only very recent versions of modern compilers support this, FunctionRef can and should be `constexpr` (demonstration here: https://godbolt.org/g/NJ72RG). This change also changes the `FunctionRef` constructor such that it no longer participates in overload resolution if the argument is not callable with the specified arguments. In addition, it perfectly forwards the callable object such that if it was an rvalue when it was passed to the constructor, it will be invoked as an rvalue in `operator()`. Reviewed By: yfeldblum Differential Revision: D5366720 fbshipit-source-id: bc64053213478aab5a5bd5950c7b2d6f364d86bd
Showing
Please register or sign in to comment