Simplifying GENERATOR to be like ScopeGuard
authorTom Jackson <tjackson@fb.com>
Tue, 4 Dec 2012 01:07:59 +0000 (17:07 -0800)
committerJordan DeLong <jdelong@fb.com>
Sun, 16 Dec 2012 22:46:27 +0000 (14:46 -0800)
commit62cbd21f597ed7b54507c802c141f9fcca3ba769
treeb4f929a19e0a94f8042093ea1e0ed0e794439122
parent95ad385e0055b5d324ced22dea04b58fff7eb15d
Simplifying GENERATOR to be like ScopeGuard

Summary:
It was previously breaking any time a generator included a comma, which
is pretty stupid. Now, it's modelled after `ScopeGuard`, using a little operator
overloading to get rid of the trailing `)` and sidestepping preprocessor issues.

Test Plan: Unit tests

Reviewed By: tudorb@fb.com

FB internal diff: D646825
folly/experimental/Gen-inl.h
folly/experimental/Gen.h
folly/experimental/test/GenTest.cpp