Vaucanson 1.4
|
00001 // iomanip.hxx: this file is part of the Vaucanson project. 00002 // 00003 // Vaucanson, a generic library for finite state machines. 00004 // 00005 // Copyright (C) 2004, 2005, 2006 The Vaucanson Group. 00006 // 00007 // This program is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 00010 // of the License, or (at your option) any later version. 00011 // 00012 // The complete GNU General Public Licence Notice can be found as the 00013 // `COPYING' file in the root directory. 00014 // 00015 // The Vaucanson Group consists of people listed in the `AUTHORS' file. 00016 // 00017 #ifndef VCSN_MISC_IOMANIP_HXX 00018 # define VCSN_MISC_IOMANIP_HXX 00019 00028 # include <vaucanson/misc/iomanip.hh> 00029 00030 namespace vcsn 00031 { 00032 namespace misc 00033 { 00034 00035 /*--------. 00036 | iomanip | 00037 `--------*/ 00038 00039 template <class Self> 00040 const Self& 00041 iomanip<Self>::self () const 00042 { 00043 return *static_cast<const Self*> (this); 00044 } 00045 00046 template <class IOM> 00047 std::ostream& 00048 operator<< (std::ostream& ostr, const iomanip<IOM>& m) 00049 { 00050 return m.self () (ostr); 00051 } 00052 00053 /*-------------. 00054 | pword_delete | 00055 `-------------*/ 00056 00057 template <class T> 00058 void 00059 pword_delete (std::ios_base::event ev, std::ios_base &io, int idx) 00060 { 00061 if (ev == std::ios_base::erase_event) 00062 delete static_cast<T*> (io.pword (idx)); 00063 } 00064 00065 } // End of namespace misc. 00066 } // End of namespace vcsn. 00067 00068 #endif // ! VCSN_MISC_IOMANIP_HXX