Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

basics/pointerOutput.hh
Go to the documentation of this file.
00001 /* Alternative output of pointer (as dereference if possible)
00002  */
00003 
00004 #ifndef pointeroutput_hh
00005 #define pointeroutput_hh
00006 
00007 #include "outputOperator.hh"
00008 
00009 namespace concepts {
00010 
00011  // ********************************************************** pointerOutput **
00012 
00013   template<class F>
00014   void pointerOutput(std::ostream& os, const F& val) {
00015     os << val;
00016   }
00017 
00018   template<class F>
00019   void pointerOutput(std::ostream& os, const F* val) {
00020     if (val) os << "&" << *val;  // pointer to value
00021     else os << "0";
00022   }
00023 
00024   template<class F>
00025   void pointerOutput(std::ostream& os, F* val) {
00026     if (val) os << "&" << *val;  // pointer to value
00027     else os << "0";
00028   }
00029 
00030 } // namespace concepts
00031 
00032 #endif // pointeroutput_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)