Vaucanson  1.4.1
special_char_traits.hh
1 // special_char_traits.hh: 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_SPECIAL_CHAR_TRAITS_HH
18 # define VCSN_MISC_SPECIAL_CHAR_TRAITS_HH
19 
38 
39 # define VCSN_USE_GENERIC_CHAR_TRAITS_FOR(Type) \
40  template <> \
41  struct char_traits<Type> : public ::vcsn::misc::char_traits<Type> { }
42 
43 namespace std
44 {
45  // Specialize char_traits for builtin types.
46  VCSN_USE_GENERIC_CHAR_TRAITS_FOR (int);
47  VCSN_USE_GENERIC_CHAR_TRAITS_FOR (long int);
48  VCSN_USE_GENERIC_CHAR_TRAITS_FOR (unsigned int);
49  VCSN_USE_GENERIC_CHAR_TRAITS_FOR (unsigned long int);
50  VCSN_USE_GENERIC_CHAR_TRAITS_FOR (float);
51  VCSN_USE_GENERIC_CHAR_TRAITS_FOR (double);
52  VCSN_USE_GENERIC_CHAR_TRAITS_FOR (long double);
53 
54  // Specialize char_traits for pointers.
55  template <class T>
56  struct char_traits<T*> : public ::vcsn::misc::char_traits<T*> { };
57 
58  // Specialize char_traits for pairs.
59  template <class U, class V>
60  struct char_traits< pair<U, V> > :
61  public ::vcsn::misc::char_traits< pair<U, V> >
62  {
63  };
64 } // end of namespace std
65 
66 #endif // ! VCSN_MISC_SPECIAL_CHAR_TRAITS_HH