Allow folly to compile cleanly with most of the rest of MSVC's sign mismatch warnings
[folly.git] / folly / dynamic-inl.h
index c1be95b94dc71111103a0f9f7e4c7dd22e236fb3..09c1b6a74f5aedc5a9f858bfa186bd05d4c4c54a 100644 (file)
@@ -288,7 +288,7 @@ struct dynamic::NumericTypeHelper<double> {
 template<class T, class NumericType /* = typename NumericTypeHelper<T>::type */>
 dynamic::dynamic(T t) {
   type_ = TypeInfo<NumericType>::type;
-  new (getAddress<NumericType>()) NumericType(t);
+  new (getAddress<NumericType>()) NumericType(NumericType(t));
 }
 
 template <class Iterator>
@@ -507,7 +507,7 @@ inline bool dynamic::empty() const {
 }
 
 inline std::size_t dynamic::count(dynamic const& key) const {
-  return find(key) != items().end();
+  return find(key) != items().end() ? 1u : 0u;
 }
 
 inline dynamic::const_item_iterator dynamic::find(dynamic const& key) const {