binary_expr.h
Go to the documentation of this file.
1 /*
2  * This file is a part of TiledArray.
3  * Copyright (C) 2013 Virginia Tech
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Justus Calvin
19  * Department of Chemistry, Virginia Tech
20  *
21  * binary_expr.h
22  * Apr 1, 2014
23  *
24  */
25 
26 #ifndef TILEDARRAY_EXPRESSIONS_BINARY_H__INCLUDED
27 #define TILEDARRAY_EXPRESSIONS_BINARY_H__INCLUDED
28 
31 
32 namespace TiledArray {
33 namespace expressions {
34 
36 
38 template <typename Derived>
39 class BinaryExpr : public Expr<Derived> {
40  public:
42  typedef typename ExprTrait<Derived>::left_type
44  typedef typename ExprTrait<Derived>::right_type
46 
47  private:
48  left_type left_;
49  right_type right_;
50 
51  public:
52  // Compiler generated functions
53  BinaryExpr(const BinaryExpr_&) = default;
54  BinaryExpr(BinaryExpr_&&) = default;
55  ~BinaryExpr() = default;
56  BinaryExpr_& operator=(const BinaryExpr_&) = delete;
58 
61  : left_(left), right_(right) {}
62 
64 
66  const left_type& left() const { return left_; }
67 
69 
71  const right_type& right() const { return right_; }
72 
73 }; // class BinaryExpr
74 
75 } // namespace expressions
76 } // namespace TiledArray
77 
78 #endif // TILEDARRAY_EXPRESSIONS_BINARY_BASE_H__INCLUDED
BinaryExpr< Derived > BinaryExpr_
This class type.
Definition: binary_expr.h:41
BinaryExpr(const left_type &left, const right_type &right)
Binary expression constructor.
Definition: binary_expr.h:60
BinaryExpr(BinaryExpr_ &&)=default
Base class for expression evaluation.
Definition: expr.h:97
Binary expression object.
Definition: binary_expr.h:39
BinaryExpr(const BinaryExpr_ &)=default
ExprTrait< Derived >::right_type right_type
The right-hand expression type.
Definition: binary_expr.h:45
const left_type & left() const
Left-hand expression argument accessor.
Definition: binary_expr.h:66
BinaryExpr_ & operator=(const BinaryExpr_ &)=delete
ExprTrait< Derived >::left_type left_type
The left-hand expression type.
Definition: binary_expr.h:43
const right_type & right() const
Right-hand expression argument accessor.
Definition: binary_expr.h:71
BinaryExpr_ & operator=(BinaryExpr_ &&)=delete