No need for a wrapping structure for posixTimeToDuration
authorYedidya Feldblum <yfeldblum@fb.com>
Mon, 20 Nov 2017 21:29:48 +0000 (13:29 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 20 Nov 2017 21:47:32 +0000 (13:47 -0800)
commit3c9a6e9a15092db11c543c8bae51957b176fcedd
tree46ba7d534389dc62d3db557ef87d04d2a6a31075
parent7046d43c7e3c18ebc28c62141b8e1eefabce5323
No need for a wrapping structure for posixTimeToDuration

Summary:
[Folly] No need for a wrapping structure for `posixTimeToDuration`.

We can just use a variant of tag dispatch. In this variant, we pass to `posixTimeToDuration` a default-initialized value of the desired return type and we write overload templates for each possible variant. The argument is used purely for overload resolution and return type deduction, not for its runtime value. It is slightly different from tag dispatch because we do not use separate types which are purely tag types.

Reviewed By: simpkins

Differential Revision: D6371572

fbshipit-source-id: 1987dee31fceec8733caa61495e96489dbf1ca39
folly/chrono/Conv.h