TiledArray  0.7.0
unary_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  * unary_expr.h
22  * Apr 1, 2014
23  *
24  */
25 
26 #ifndef TILEDARRAY_EXPRESSIONS_UNARY_EXPR_H__INCLUDED
27 #define TILEDARRAY_EXPRESSIONS_UNARY_EXPR_H__INCLUDED
28 
31 
32 namespace TiledArray {
33  namespace expressions {
34 
35  template <typename Derived>
36  class UnaryExpr : public Expr<Derived> {
37  public:
40 
41  private:
42 
43  argument_type arg_;
44 
45  public:
46 
47  // Compiler generated functions
48  UnaryExpr(const UnaryExpr_&) = default;
49  UnaryExpr(UnaryExpr_&&) = default;
50  ~UnaryExpr() = default;
51  UnaryExpr_& operator=(const UnaryExpr_&) = delete;
52  UnaryExpr_& operator=(UnaryExpr_&&) = delete;
53 
55 
57  UnaryExpr(const argument_type& arg) : arg_(arg) { }
58 
59 
61 
63  const argument_type& arg() const { return arg_; }
64 
65  }; // class UnaryExpr
66 
67  } // namespace expressions
68 } // namespace TiledArray
69 
70 #endif // TILEDARRAY_EXPRESSIONS_UNARY_EXPR_H__INCLUDED
UnaryExpr< Derived > UnaryExpr_
Definition: unary_expr.h:38
UnaryExpr_ & operator=(const UnaryExpr_ &)=delete
UnaryExpr(const argument_type &arg)
Constructor.
Definition: unary_expr.h:57
const argument_type & arg() const
Argument expression accessor.
Definition: unary_expr.h:63
ExprTrait< Derived >::argument_type argument_type
The expression type.
Definition: unary_expr.h:39
UnaryExpr(const UnaryExpr_ &)=default