Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. // -*- c++ -*-
  2. /*
  3.  * Copyright 1999 Karl Nelson <kenelson@ece.ucdavis.edu>
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Library General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Library General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Library General Public
  16.  * License along with this library; if not, write to the Free
  17.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19. #ifndef SIGCXX_TYPE_H
  20. #define SIGCXX_TYPE_H
  21.  
  22. #include <sigc++config.h>
  23.  
  24. #ifdef SIGC_CXX_NAMESPACES
  25. namespace SigC
  26. {
  27. #endif
  28.  
  29. /* some classes for making parameter passing easier */
  30.  
  31. #ifdef SIGC_CXX_SPECIALIZE_REFERENCES
  32. template <typename T>
  33. struct Trait
  34.   {
  35.    typedef const T& ref;
  36.    typedef T        type;
  37.   };
  38.  
  39. template <typename T>
  40. struct Trait<T&>
  41.   {
  42.    typedef T& ref;
  43.    typedef T& type;
  44.   };
  45. #else
  46. template <typename T>
  47. struct Trait
  48.   {
  49.    typedef T ref;  // VC++ does not support reference typedef
  50.    typedef T type;
  51.   };
  52. #endif
  53.  
  54. template <>
  55. struct Trait<void>:public Trait<int>
  56.   {};
  57.  
  58.  
  59. #ifdef SIGC_CXX_NAMESPACES
  60. }
  61. #endif
  62.  
  63. #endif
  64.