Fix tryTo to support conversion to enumerations v2017.05.29.00
authorQinfan Wu <wqfish@fb.com>
Sun, 28 May 2017 20:49:28 +0000 (13:49 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 28 May 2017 20:50:25 +0000 (13:50 -0700)
commite49575d4bf1bc6408952d6b469d9b80d53729263
tree70424b211df712fae71bb0269bed240c07b18439
parent3a78d442da886c3720c647fd41c94c0afbf9f8e1
Fix tryTo to support conversion to enumerations

Summary:
[Folly] Fix `tryTo` to support conversion to enumerations.

`tryTo` should return `Expected<Tgt, ConversionCode>` instead of `Tgt`.

Reviewed By: yfeldblum

Differential Revision: D5144706

fbshipit-source-id: cd23f3cf75de7c5a26bc569f3cb47fff360f6e2a
folly/Conv.h
folly/test/ConvTest.cpp