Enabling folly::Synchronized for non-default constructible objects
Summary:
Currently folly::Synchronized can't be used with non-default
constructible types because copy and move constructors require
creation of datum_ before it's assignment.
To fix this we can initialize them in initializer-list and
handle guard creation using helper constructor
Test Plan:
fbconfig -r folly && fbmake runtests
Fixes compilation error: Synchronized started working for non-default
constructible types in my project(rfe).
Reviewed By: yuri@fb.com
Subscribers: dhruvbird
FB internal diff:
D1502110