MLPACK  1.0.8
nulloutstream.hpp
Go to the documentation of this file.
1 
23 #ifndef __MLPACK_CORE_UTIL_NULLOUTSTREAM_HPP
24 #define __MLPACK_CORE_UTIL_NULLOUTSTREAM_HPP
25 
26 #include <iostream>
27 #include <streambuf>
28 #include <string>
29 
30 namespace mlpack {
31 namespace util {
32 
38 {
39  public:
44 
48  NullOutStream(const NullOutStream& /* other */) { }
49 
50  /*
51  We use (void) paramName in order to avoid the warning generated by
52  -Wextra. For some currently unknown reason, simply deleting the
53  parameter name (aka, outperator<<(bool) {...}) causes a compilation
54  error (with -Werror off) for only this class.
55  */
56 
58  NullOutStream& operator<<(bool val) { (void) val; return *this; }
60  NullOutStream& operator<<(short val) { (void) val; return *this; }
62  NullOutStream& operator<<(unsigned short val) { (void) val; return *this; }
64  NullOutStream& operator<<(int val) { (void) val; return *this; }
66  NullOutStream& operator<<(unsigned int val) { (void) val; return *this; }
68  NullOutStream& operator<<(long val) { (void) val; return *this; }
70  NullOutStream& operator<<(unsigned long val) { (void) val; return *this; }
72  NullOutStream& operator<<(float val) { (void) val; return *this; }
74  NullOutStream& operator<<(double val) { (void) val; return *this; }
76  NullOutStream& operator<<(long double val) { (void) val; return *this; }
78  NullOutStream& operator<<(void* val) { (void) val; return *this; }
80  NullOutStream& operator<<(const char* str) { (void) str; return *this; }
82  NullOutStream& operator<<(std::string& str) { (void) str; return *this; }
84  NullOutStream& operator<<(std::streambuf* sb) { (void) sb; return *this; }
86  NullOutStream& operator<<(std::ostream& (*pf) (std::ostream&))
87  { (void) pf; return *this; }
89  NullOutStream& operator<<(std::ios& (*pf) (std::ios&)) { (void) pf; return *this; }
91  NullOutStream& operator<<(std::ios_base& (*pf) (std::ios_base&))
92  { (void) pf; return *this; }
93 
95  template<typename T>
97  { (void) s; return *this; }
98 };
99 
100 } // namespace util
101 } // namespace mlpack
102 
103 #endif
NullOutStream & operator<<(std::ios_base &(*pf)(std::ios_base &))
Does nothing.
NullOutStream & operator<<(std::streambuf *sb)
Does nothing.
NullOutStream & operator<<(unsigned long val)
Does nothing.
NullOutStream & operator<<(unsigned int val)
Does nothing.
NullOutStream & operator<<(std::string &str)
Does nothing.
NullOutStream & operator<<(int val)
Does nothing.
NullOutStream & operator<<(std::ostream &(*pf)(std::ostream &))
Does nothing.
NullOutStream(const NullOutStream &)
Does nothing.
NullOutStream & operator<<(double val)
Does nothing.
NullOutStream & operator<<(T &s)
Does nothing.
NullOutStream & operator<<(bool val)
Does nothing.
NullOutStream & operator<<(long val)
Does nothing.
NullOutStream & operator<<(long double val)
Does nothing.
NullOutStream & operator<<(float val)
Does nothing.
NullOutStream & operator<<(const char *str)
Does nothing.
NullOutStream & operator<<(short val)
Does nothing.
NullOutStream & operator<<(unsigned short val)
Does nothing.
NullOutStream & operator<<(void *val)
Does nothing.
Used for Log::Debug when not compiled with debugging symbols.
NullOutStream & operator<<(std::ios &(*pf)(std::ios &))
Does nothing.