- getDefault(const dynamic& k, const dynamic& v = dynamic::object) const;
- dynamic&& getDefault(const dynamic& k, dynamic&& v) const;
- template<class K, class V = dynamic>
- dynamic& setDefault(K&& k, V&& v = dynamic::object);
+ getDefault(const dynamic& k, const dynamic& v = dynamic::object) const&;
+ dynamic getDefault(const dynamic& k, dynamic&& v) const&;
+ dynamic getDefault(const dynamic& k, const dynamic& v = dynamic::object) &&;
+ dynamic getDefault(const dynamic& k, dynamic&& v) &&;
+ template<class K, class V>
+ dynamic& setDefault(K&& k, V&& v);
+ // MSVC 2015 Update 3 needs these extra overloads because if V were a
+ // defaulted template parameter, it causes MSVC to consider v an rvalue
+ // reference rather than a universal reference, resulting in it not being
+ // able to find the correct overload to construct a dynamic with.
+ template<class K>
+ dynamic& setDefault(K&& k, dynamic&& v);
+ template<class K>
+ dynamic& setDefault(K&& k, const dynamic& v = dynamic::object);