Handle MSVC in FBString.h
authorOrvid King <blah38621@gmail.com>
Wed, 29 Jul 2015 21:46:30 +0000 (14:46 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Wed, 29 Jul 2015 22:22:12 +0000 (15:22 -0700)
Summary: Specifically, MSVC doesn't define `std::__ostream_insert`, so just write to the stream instead.
Closes #270

Reviewed By: @yfeldblum

Differential Revision: D2283960

Pulled By: @sgolemon

folly/FBString.h

index 53ade9b7adad45e333f3f26bb639436974c143aa..4afce748d8bc9d433dc45439f7443da0fd6a435a 100644 (file)
@@ -2370,6 +2370,9 @@ operator<<(
       os.setstate(std::ios_base::badbit | std::ios_base::failbit);
     }
   }
+#elif defined(_MSC_VER)
+  // MSVC doesn't define __ostream_insert
+  os.write(str.data(), str.size());
 #else
   std::__ostream_insert(os, str.data(), str.size());
 #endif