Add mechanizm for caching local and peer addresses in AsyncSSLSocket.
[folly.git] / folly / dynamic-inl.h
index 8924fb3d9bff7641b10ced941fe84c532da5c7e8..73ab5d37184e535c9b0e7e60b41b0d3508420c12 100644 (file)
@@ -282,6 +282,11 @@ inline dynamic::dynamic(fbstring&& s)
   new (&u_.string) fbstring(std::move(s));
 }
 
+inline dynamic& dynamic::operator=(std::initializer_list<dynamic> il) {
+  (*this) = dynamic(il);
+  return *this;
+}
+
 inline dynamic::dynamic(std::initializer_list<dynamic> il)
   : type_(ARRAY)
 {
@@ -723,6 +728,14 @@ struct dynamic::PrintImpl {
     out << t;
   }
 };
+// Otherwise, null, being (void*)0, would print as 0.
+template <>
+struct dynamic::PrintImpl<void*> {
+  static void print(dynamic const& d, std::ostream& out, void* const& nul) {
+    DCHECK_EQ((void*)0, nul);
+    out << "null";
+  }
+};
 template<>
 struct dynamic::PrintImpl<dynamic::ObjectImpl> {
   static void print(dynamic const& d,