HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
formula_bit_and_node.hpp
1// Copyright Take Vos 2020.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "formula_binary_operator_node.hpp"
8
9namespace tt {
10
14
15 datum evaluate(formula_evaluation_context& context) const override {
16 auto lhs_ = lhs->evaluate(context);
17 auto rhs_ = rhs->evaluate(context);
18 try {
19 return lhs_ & rhs_;
20 } catch (std::exception const &e) {
21 throw operation_error("{}: Can not evaluate binary-and.\n{}", location, e.what());
22 }
23 }
24
25 std::string string() const noexcept override {
26 return std::format("({} & {})", *lhs, *rhs);
27 }
28};
29
30}
A dynamic data type.
Definition datum.hpp:213
Exception thrown during execution of a dynamic operation.
Definition exception.hpp:42
Definition formula_binary_operator_node.hpp:11
Definition formula_bit_and_node.hpp:11
datum evaluate(formula_evaluation_context &context) const override
Evaluate an rvalue.
Definition formula_bit_and_node.hpp:15
Definition formula_evaluation_context.hpp:16
Definition parse_location.hpp:17
T move(T... args)
T what(T... args)