HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
formula_logical_or_node.hpp
1// Copyright Take Vos 2020-2021.
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 hi::inline v1 {
10
14 {
15 }
16
17 datum evaluate(formula_evaluation_context &context) const override
18 {
19 auto lhs_ = lhs->evaluate(context);
20 if (lhs_) {
21 return lhs_;
22 } else {
23 return rhs->evaluate(context);
24 }
25 }
26
27 std::string string() const noexcept override
28 {
29 return std::format("({} || {})", *lhs, *rhs);
30 }
31};
32
33} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:13
A dynamic data type.
Definition datum.hpp:223
Definition formula_binary_operator_node.hpp:11
Definition formula_evaluation_context.hpp:15
Definition formula_logical_or_node.hpp:11
datum evaluate(formula_evaluation_context &context) const override
Evaluate an rvalue.
Definition formula_logical_or_node.hpp:17
Definition parse_location.hpp:18
T move(T... args)