improve the APIs for creating struct and function types with no arguments/elements
[oota-llvm.git] / include / llvm / Support / Streams.h
index e9208644da4a043b995d0e7a7d16600207d0f0bb..445ab98c476d7711a325eb10851944a80d2f59d1 100644 (file)
@@ -24,9 +24,9 @@ namespace llvm {
 
   /// BaseStream - Acts like the STL streams. It's a wrapper for the std::cerr,
   /// std::cout, std::cin, etc. streams. However, it doesn't require #including
-  /// @verbatim <iostream> @endverbatm in every file (doing so increases static 
+  /// @verbatim <iostream> @endverbatm in every file (doing so increases static
   /// c'tors & d'tors in the object code).
-  /// 
+  ///
   template <typename StreamTy>
   class BaseStream {
     StreamTy *Stream;
@@ -64,6 +64,12 @@ namespace llvm {
       return *this;
     }
 
+    template <typename Ty>
+    BaseStream &write(const Ty &A, unsigned N) {
+      if (Stream) Stream->write(A, N);
+      return *this;
+    }
+
     operator StreamTy* () { return Stream; }
 
     bool operator == (const StreamTy &S) { return &S == Stream; }