Add a pair of overloads to dynamic::setDefault
authorChristopher Dykes <cdykes@fb.com>
Mon, 15 Aug 2016 18:17:38 +0000 (11:17 -0700)
committerFacebook Github Bot 2 <facebook-github-bot-2-bot@fb.com>
Mon, 15 Aug 2016 18:23:25 +0000 (11:23 -0700)
commitdf66f27a0187ee56cc5a56d425ba592425de6c39
tree660f5a951550892c228fa2699b376fd1e2bab93b
parent4d932ecc53c7a72267179e58eeed7ec56eb7dc53
Add a pair of overloads to dynamic::setDefault

Summary:
This is a workaround to an (already reported) bug in MSVC that results in it not considering the constructors of `dynamic` when attempting to construct the default value of a parameter if the type of the parameter is a universal reference.
It works by simply adding a pair of template specializations that cause MSVC to properly construct the default value.
This also removes the default value on the universal reference version, as the only things that should be using that overload now are non-dynamic values.

Reviewed By: yfeldblum

Differential Revision: D3704990

fbshipit-source-id: 7b85c4e48a1a1023bc2fe0a76a9632b11c4e9364
folly/dynamic-inl.h
folly/dynamic.h