Sacado_mpl_quote.hpp

Go to the documentation of this file.
00001 // $Id$ 
00002 // $Source$ 
00003 // @HEADER
00004 // ***********************************************************************
00005 // 
00006 //                           Sacado Package
00007 //                 Copyright (2006) Sandia Corporation
00008 // 
00009 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00010 // the U.S. Government retains certain rights in this software.
00011 // 
00012 // This library is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Lesser General Public License as
00014 // published by the Free Software Foundation; either version 2.1 of the
00015 // License, or (at your option) any later version.
00016 //  
00017 // This library is distributed in the hope that it will be useful, but
00018 // WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // Lesser General Public License for more details.
00021 //  
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License along with this library; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 // USA
00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
00027 // (etphipp@sandia.gov).
00028 // 
00029 // ***********************************************************************
00030 // @HEADER
00031 
00032 #ifndef SACADO_MPL_QUOTE_HPP
00033 #define SACADO_MPL_QUOTE_HPP
00034 
00035 #include "Sacado_mpl_type_wrap.hpp"
00036 
00037 namespace Sacado {
00038 
00039   namespace mpl {
00040    
00041     // Transform a class/template to a metafunction class 
00042     // (nested template apply)
00043     template <class F>
00044     struct quote0 {
00045       struct apply : mpl::type_wrap< F > {};
00046     };
00047 
00048     template <template<class T1> class F>
00049     struct quote1 {
00050       template <class T1> 
00051       struct apply : mpl::type_wrap< F<T1> > {};
00052     };
00053 
00054     template < template<class T1, 
00055                         class T2> class F>
00056     struct quote2 {
00057       template <class T1, 
00058                 class T2> 
00059       struct apply : mpl::type_wrap< F<T1,T2> >{};
00060     };
00061 
00062     template < template<class T1, 
00063                         class T2, 
00064                         class T3> class F>
00065     struct quote3 {
00066       template <class T1, 
00067                 class T2, 
00068                 class T3> 
00069       struct apply : mpl::type_wrap< F<T1,T2,T3> >{};
00070     };
00071 
00072     template < template<class T1, 
00073                         class T2, 
00074                         class T3, 
00075                         class T4> class F>
00076     struct quote4 {
00077       template <class T1, 
00078                 class T2, 
00079                 class T3,
00080                 class T4> 
00081       struct apply : mpl::type_wrap< F<T1,T2,T3,T4> >{};
00082     };
00083 
00084     template < template<class T1, 
00085                         class T2, 
00086                         class T3, 
00087                         class T4, 
00088                         class T5> class F>
00089     struct quote5 {
00090       template <class T1, 
00091                 class T2, 
00092                 class T3,
00093                 class T4,
00094                 class T5> 
00095       struct apply : mpl::type_wrap< F<T1,T2,T3,T4,T5> >{};
00096     };
00097 
00098     template <class F>
00099     struct quote : quote0<F> {};
00100 
00101     template < template<class T1> class F,
00102                class T1>
00103     struct quote< F<T1> > : quote1<F> {};
00104 
00105     template < template<class T1, 
00106                         class T2> class F,
00107                class T1,
00108                class T2>
00109     struct quote< F<T1,T2> > : quote2<F> {};
00110 
00111     template < template<class T1, 
00112                         class T2, 
00113                         class T3> class F,
00114                class T1,
00115                class T2,
00116                class T3>
00117     struct quote< F<T1,T2,T3> > : quote3<F> {};
00118 
00119     template < template<class T1, 
00120                         class T2, 
00121                         class T3, 
00122                         class T4> class F,
00123                class T1,
00124                class T2,
00125                class T3,
00126                class T4>
00127     struct quote< F<T1,T2,T3,T4> > : quote4<F> {};
00128 
00129     template < template<class T1, 
00130                         class T2, 
00131                         class T3, 
00132                         class T4, 
00133                         class T5> class F,
00134                class T1,
00135                class T2,
00136                class T3,
00137                class T4,
00138                class T5>
00139     struct quote< F<T1,T2,T3,T4,T5> > : quote5<F> {};
00140 
00141   } // namespace mpl
00142 
00143 } // namespace Sacado
00144 
00145 #endif // SACADO_MPL_QUOTE_HPP

Generated on Wed May 12 21:39:35 2010 for Sacado Package Browser (Single Doxygen Collection) by  doxygen 1.4.7