Vaucanson  1.4.1
iomanip.hxx
Go to the documentation of this file.
1 // iomanip.hxx: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2004, 2005, 2006 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 #ifndef VCSN_MISC_IOMANIP_HXX
18 # define VCSN_MISC_IOMANIP_HXX
19 
28 # include <vaucanson/misc/iomanip.hh>
29 
30 namespace vcsn
31 {
32  namespace misc
33  {
34 
35  /*--------.
36  | iomanip |
37  `--------*/
38 
39  template <class Self>
40  const Self&
41  iomanip<Self>::self () const
42  {
43  return *static_cast<const Self*> (this);
44  }
45 
46  template <class IOM>
47  std::ostream&
48  operator<< (std::ostream& ostr, const iomanip<IOM>& m)
49  {
50  return m.self () (ostr);
51  }
52 
53  /*-------------.
54  | pword_delete |
55  `-------------*/
56 
57  template <class T>
58  void
59  pword_delete (std::ios_base::event ev, std::ios_base &io, int idx)
60  {
61  if (ev == std::ios_base::erase_event)
62  delete static_cast<T*> (io.pword (idx));
63  }
64 
65  } // End of namespace misc.
66 } // End of namespace vcsn.
67 
68 #endif // ! VCSN_MISC_IOMANIP_HXX