Spicy
move.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <utility>
6 
7 #include <hilti/ast/expression.h>
8 
9 namespace hilti {
10 namespace expression {
11 
13 class Move : public NodeBase, public trait::isExpression {
14 public:
15  Move(Expression e, Meta m = Meta()) : NodeBase({std::move(e)}, std::move(m)) {}
16 
17  const auto& expression() const { return child<Expression>(0); }
18 
19  bool operator==(const Move& other) const { return expression() == other.expression(); }
20 
22  bool isLhs() const { return false; }
24  bool isTemporary() const { return true; }
26  auto type() const { return expression().type(); }
28  auto isConstant() const { return expression().isConstant(); }
30  auto isEqual(const Expression& other) const { return node::isEqual(this, other); }
31 
33  auto properties() const { return node::Properties{}; }
34 };
35 
36 } // namespace expression
37 } // namespace hilti
auto properties() const
Definition: move.h:33
Definition: expression.h:16
Definition: meta.h:18
bool isTemporary() const
Definition: move.h:24
auto isEqual(const Expression &other) const
Definition: move.h:30
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
auto type() const
Definition: move.h:26
Definition: move.h:13
bool isLhs() const
Definition: move.h:22
auto isConstant() const
Definition: move.h:28
Definition: node.h:318