Add method, that constructs Try<T> based on the result of functor.
authorStepan Palamarchuk <stepan@fb.com>
Tue, 25 Feb 2014 22:42:55 +0000 (14:42 -0800)
committerDave Watson <davejwatson@fb.com>
Fri, 28 Feb 2014 22:02:58 +0000 (14:02 -0800)
commit7bdae2997189e8cde6a2d9f1cd28d9700cb3d702
treefb7eedc34f5216ee0dfc285edae344128b4a792c
parent29ba8408181362420acb20bcad2a82f22e033d19
Add method, that constructs Try<T> based on the result of functor.

Summary:
Usually we construct Try<T> as a result of execution of some functor.
And we need to treat void and non-void functors in similar way, but that requires different, yet similar pieces of code.

This diff simplifies future usage of Try.

Test Plan: compile only

Reviewed By: andrii@fb.com

FB internal diff: D1190296
folly/wangle/Try-inl.h
folly/wangle/Try.h
folly/wangle/test/Try.cpp [new file with mode: 0644]