ESyS-Particle  4.0.1
Functional.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 #ifndef ESYS_LSMFUNCTIONAL_H
00014 #define ESYS_LSMFUNCTIONAL_H
00015 
00016 #if HAVE_CONFIG_H
00017 #include "config.h"
00018 #endif
00019 
00020 #if HAVE_EXT_FUNCTIONAL
00021 #include <ext/functional>
00022 #endif
00023 #if HAVE_FUNCTIONAL
00024 #include <functional>
00025 #endif
00026 
00027 #if HAVE_STD__SELECT1ST_PAIR_
00028 namespace ext {
00029 template <class _Pair> struct select1st
00030   : public std::select1st<_Pair> {};
00031 }
00032 #elif HAVE___GNU_CXX__SELECT1ST_PAIR_
00033 namespace ext {
00034 template <class _Pair> struct select1st
00035   : public __gnu_cxx::select1st<_Pair> {};
00036 }
00037 #elif !HAVE_EXT__SELECT1ST_PAIR_
00038 namespace ext
00039 {
00040   template <class _Pair>
00041   struct select1st
00042     : public std::unary_function<_Pair, typename _Pair::first_type>
00043   {
00044     typename _Pair::first_type&
00045     operator()(_Pair& __x) const
00046     { return __x.first; }
00047 
00048     const typename _Pair::first_type&
00049     operator()(const _Pair& __x) const
00050     { return __x.first; }
00051   };
00052 }
00053 #endif
00054 
00055 #if HAVE_STD__SELECT2ND_PAIR_
00056 namespace ext {
00057 template <class _Pair> struct select2nd
00058   : public std::select2nd<_Pair> {};
00059 }
00060 #elif HAVE___GNU_CXX__SELECT2ND_PAIR_
00061 namespace ext {
00062 template <class _Pair> struct select2nd
00063   : public __gnu_cxx::select2nd<_Pair> {};
00064 }
00065 #elif !HAVE_EXT__SELECT2ND_PAIR_
00066 namespace ext
00067 {
00068   template <class _Pair>
00069   struct select2nd
00070     : public std::unary_function<_Pair, typename _Pair::second_type>
00071   {
00072     typename _Pair::second_type&
00073     operator()(_Pair& __x) const
00074     { return __x.second; }
00075 
00076     const typename _Pair::second_type&
00077     operator()(const _Pair& __x) const
00078     { return __x.second; }
00079   };
00080 }
00081 #endif
00082 
00083 #endif