⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fnoperators.h

📁 精确的函数表达模板,里面包含了许多C和C++的函数表达模板
💻 H
📖 第 1 页 / 共 4 页
字号:
   }
   /////////////////////////////////////////////////////////////////////////////
   // operator<(Expr, Expr)   template<class A, class B>   Expr<BinExpr< Expr<A>                                   // Arg1               , Expr<B>                                   // Arg2               , Less< typename Expr<A>::result_type       // Oper                     , typename Expr<B>::result_type                     , bool > > >   operator<(const Expr<A>& a, const Expr<B>& b)   {      typedef typename Expr<A>::result_type arg1_t;      typedef typename Expr<B>::result_type arg2_t;      typedef typename BinExpr<Expr<A>, Expr<B>, Less<arg1_t, arg2_t, bool> > binExprT;      return Expr<binExprT>(binExprT(a,b));   }

   // operator<(double, Expr)
   template<class B>   Expr<BinExpr< LiteralExpr<double>                    // Arg1               , typename Expr<B>::result_type          // Arg2               , Less< double                           // Oper                     , typename Expr<B>::result_type                     , bool > > >   operator<(const double& l, const Expr<B>& b)   {      typedef double   arg1_t;      typedef typename Expr<B>::result_type arg2_t;      typedef typename BinExpr<LiteralExpr<arg1_t>, Expr<B>, Less<arg1_t, arg2_t, bool> >binExprT;      return Expr<binExprT>(binExprT(LiteralExpr<arg1_t>(l),b));   }   // operator<(Expr, double)   template<class A>   Expr<BinExpr< Expr<A>                                   // Arg1               , LiteralExpr<double>                       // Arg2               , Less< typename Expr<A>::result_type       // Oper                         , double                         , bool > > >   operator<(const Expr<A>& a, const double& l)   {      typedef double   arg2_t;      typedef typename Expr<A>::result_type arg1_t;      typedef typename BinExpr<Expr<A>, LiteralExpr<arg2_t>, Less<arg1_t, arg2_t, bool> > binExprT;      return Expr<binExprT>(binExprT(a, LiteralExpr<arg2_t>(l)));   }   // operator<(int, Expr)   template<class B>   Expr<BinExpr< LiteralExpr<int>                           // Arg1               , Expr<B>                                    // Arg2               , Less< int                                  // Oper                     , typename Expr<B>::result_type                     , bool > > >   operator<(const int& l, const Expr<B>& b)   {      typedef int      arg1_t;      typedef typename Expr<B>::result_type arg2_t;      typedef typename BinExpr<LiteralExpr<arg1_t>, Expr<B>, Less<arg1_t, arg2_t, bool> >binExprT;      return Expr<binExprT>(binExprT(LiteralExpr<arg1_t>(l),b));   }   // operator<(Expr, int)   template<class A>   Expr<BinExpr< Expr<A>                                   // Arg1               , LiteralExpr<int>                          // Arg2               , Less< typename Expr<A>::result_type       // Oper                     , int                     , bool > > >   operator<(const Expr<A>& a, const int& l)   {      typedef int      arg2_t;      typedef typename Expr<A>::result_type arg1_t;      typedef typename BinExpr<Expr<A>, LiteralExpr<arg2_t>, Less<arg1_t, arg2_t, bool> > binExprT;      return Expr<binExprT>(binExprT(a, LiteralExpr<arg2_t>(l)));   }

   /////////////////////////////////////////////////////////////////////////////
   // operator<=(Expr, Expr)   template<class A, class B>   Expr<BinExpr< Expr<A>                                   // Arg1               , Expr<B>                                   // Arg2               , LessEq< typename Expr<A>::result_type     // Oper                       , typename Expr<B>::result_type                       , bool > > >   operator<=(const Expr<A>& a, const Expr<B>& b)   {      typedef typename Expr<A>::result_type arg1_t;      typedef typename Expr<B>::result_type arg2_t;      typedef typename BinExpr<Expr<A>, Expr<B>, LessEq<arg1_t, arg2_t, bool> > binExprT;      return Expr<binExprT>(binExprT(a,b));   }

   // operator<=(double, Expr)
   template<class B>   Expr<BinExpr< LiteralExpr<double>                    // Arg1               , typename Expr<B>::result_type          // Arg2               , LessEq< double                         // Oper                       , typename Expr<B>::result_type                       , bool > > >   operator<=(const double& l, const Expr<B>& b)   {      typedef double   arg1_t;      typedef typename Expr<B>::result_type arg2_t;      typedef typename BinExpr<LiteralExpr<arg1_t>, Expr<B>, LessEq<arg1_t, arg2_t, bool> >binExprT;      return Expr<binExprT>(binExprT(LiteralExpr<arg1_t>(l),b));   }   // operator<=(Expr, double)   template<class A>   Expr<BinExpr< Expr<A>                                   // Arg1               , LiteralExpr<double>                       // Arg2               , LessEq< typename Expr<A>::result_type     // Oper                       , double                       , bool > > >   operator<=(const Expr<A>& a, const double& l)   {      typedef double   arg2_t;      typedef typename Expr<A>::result_type arg1_t;      typedef typename BinExpr<Expr<A>, LiteralExpr<arg2_t>, LessEq<arg1_t, arg2_t, bool> > binExprT;      return Expr<binExprT>(binExprT(a, LiteralExpr<arg2_t>(l)));   }   // operator<=(int, Expr)   template<class B>   Expr<BinExpr< LiteralExpr<int>                           // Arg1               , Expr<B>                                    // Arg2               , LessEq< int                                // Oper                       , typename Expr<B>::result_type                       , bool > > >   operator<=(const int& l, const Expr<B>& b)   {      typedef int      arg1_t;      typedef typename Expr<B>::result_type arg2_t;      typedef typename BinExpr<LiteralExpr<arg1_t>, Expr<B>, LessEq<arg1_t, arg2_t, bool> >binExprT;      return Expr<binExprT>(binExprT(LiteralExpr<arg1_t>(l),b));   }   // operator<=(Expr, int)   template<class A>   Expr<BinExpr< Expr<A>                                   // Arg1               , LiteralExpr<int>                          // Arg2               , LessEq< typename Expr<A>::result_type     // Oper                       , int                       , bool > > >   operator<=(const Expr<A>& a, const int& l)   {      typedef int      arg2_t;      typedef typename Expr<A>::result_type arg1_t;      typedef typename BinExpr<Expr<A>, LiteralExpr<arg2_t>, LessEq<arg1_t, arg2_t, bool> > binExprT;      return Expr<binExprT>(binExprT(a, LiteralExpr<arg2_t>(l)));   }

   /////////////////////////////////////////////////////////////////////////////
   // operator>(Expr, Expr)   template<class A, class B>   Expr<BinExpr< Expr<B>                                   // Arg1               , Expr<A>                                   // Arg2               , Less< typename Expr<B>::result_type       // Oper                     , typename Expr<A>::result_type                     , bool > > >   operator>(const Expr<A>& a, const Expr<B>& b)   {      return operator <(b,a);   }
   // operator>(double, Expr)
   template<class B>   Expr<BinExpr< typename Expr<B>::result_type          // Arg1               , LiteralExpr<double>                    // Arg2               , Less< typename Expr<B>::result_type    // Oper                     , double                     , bool > > >   operator>(const double& l, const Expr<B>& b)   {      return operator <(b,l);   }   // operator>(Expr, double)   template<class A>   Expr<BinExpr< LiteralExpr<double>            // Arg1               , Expr<A>                        // Arg2               , Less< double                   // Oper                     , typename Expr<A>::result_type                     , bool > > >   operator>(const Expr<A>& a, const double& l)   {      return operator <(l, a);   }   // operator>(int, Expr)   template<class B>   Expr<BinExpr< typename Expr<B>::result_type          // Arg1               , LiteralExpr<int>                       // Arg2               , Less< typename Expr<B>::result_type    // Oper                     , int                     , bool > > >   operator>(const int& l, const Expr<B>& b)   {      return operator <(b,l);   }   // operator>(Expr, int)   template<class A>   Expr<BinExpr< LiteralExpr<int>                   // Arg1               , Expr<A>                            // Arg2               , Less< int                          // Oper                     , typename Expr<A>::result_type                     , bool > > >   operator>(const Expr<A>& a, const int& l)   {      return operator <(l, a);   }   /////////////////////////////////////////////////////////////////////////////
   // operator>=(Expr, Expr)   template<class A, class B>   Expr<BinExpr< Expr<B>                                   // Arg1               , Expr<A>                                   // Arg2               , LessEq< typename Expr<B>::result_type       // Oper                       , typename Expr<A>::result_type                       , bool > > >   operator>=(const Expr<A>& a, const Expr<B>& b)   {      return operator <=(b,a);   }
   // operator>=(double, Expr)
   template<class B>   Expr<BinExpr< typename Expr<B>::result_type          // Arg1               , LiteralExpr<double>                    // Arg2               , LessEq< typename Expr<B>::result_type    // Oper                       , double                       , bool > > >   operator>=(const double& l, const Expr<B>& b)   {      return operator <=(b,l);   }   // operator>=(Expr, double)   template<class A>   Expr<BinExpr< LiteralExpr<double>            // Arg1               , Expr<A>                        // Arg2               , LessEq< double                   // Oper                       , typename Expr<A>::result_type                       , bool > > >   operator>=(const Expr<A>& a, const double& l)   {      return operator <=(l, a);   }   // operator>=(int, Expr)   template<class B>   Expr<BinExpr< typename Expr<B>::result_type          // Arg1               , LiteralExpr<int>                       // Arg2               , LessEq< typename Expr<B>::result_type    // Oper                       , int                       , bool > > >   operator>=(const int& l, const Expr<B>& b)   {      return operator <=(b,l);   }   // operator>=(Expr, int)   template<class A>   Expr<BinExpr< LiteralExpr<int>                   // Arg1               , Expr<A>                            // Arg2               , LessEq< int                        // Oper                       , typename Expr<A>::result_type                       , bool > > >   operator>=(const Expr<A>& a, const int& l)   {      return operator <=(l, a);   }
   /////////////////////////////////////////////////////////////////////////////
   // operator==(Expr, Expr)   template<class A, class B>   Expr<BinExpr< Expr<A>                                   // Arg1               , Expr<B>                                   // Arg2               , Equal< typename Expr<A>::result_type      // Oper                      , typename Expr<B>::result_type                      , bool > > >   operator==(const Expr<A>& a, const Expr<B>& b)   {      typedef typename Expr<A>::result_type arg1_t;      typedef typename Expr<B>::result_type arg2_t;      typedef typename BinExpr<Expr<A>, Expr<B>, Equal<arg1_t, arg2_t, bool> > binExprT;      return Expr<binExprT>(binExprT(a,b));   }

   // operator==(double, Expr)
   template<class B>   Expr<BinExpr< LiteralExpr<double>                        // Arg1               , Expr<B>                                    // Arg2

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -