iomanip.hxx

Go to the documentation of this file.
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 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 utility
00031 {
00032 
00033   /*--------.
00034   | iomanip |
00035   `--------*/
00036 
00037   template <class Self>
00038   const Self&
00039   iomanip<Self>::self() const
00040   {
00041     return *static_cast<const Self*> (this);
00042   }
00043 
00044   template <class IOM>
00045   std::ostream&
00046   operator << (std::ostream& ostr, const iomanip<IOM>& m)
00047   {
00048     return m.self() (ostr);
00049   }
00050 
00051   /*-------------.
00052   | pword_delete |
00053   `-------------*/
00054 
00055   template <class T>
00056   void
00057   pword_delete(std::ios_base::event ev, std::ios_base &io, int idx)
00058   {
00059     if (ev == std::ios_base::erase_event)
00060       delete static_cast<T*> (io.pword(idx));
00061   }
00062 
00063 } // End of namespace utility.
00064 
00065 #endif // ! VCSN_MISC_IOMANIP_HXX

Generated on Fri Jul 28 12:18:34 2006 for Vaucanson by  doxygen 1.4.6