std::basic_ostream operator<< overload for FixedString
[folly.git] / folly / FixedString.h
index 935cd8214b2489188ded057cf0b9146ed6e94730..bf0d52e32a0b10a44841113ebc3f1eb77582ea63 100644 (file)
@@ -2938,6 +2938,15 @@ class BasicFixedString : private detail::fixedstring::FixedStringBase {
   }
 };
 
+template <class C, std::size_t N>
+inline std::basic_ostream<C>& operator<<(
+    std::basic_ostream<C>& os,
+    const BasicFixedString<C, N>& string) {
+  using StreamSize = decltype(os.width());
+  os.write(string.begin(), static_cast<StreamSize>(string.size()));
+  return os;
+}
+
 /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
  * Symmetric relational operators
  */