18#ifndef LIVE_CELLS_BOOLEAN_HPP
19#define LIVE_CELLS_BOOLEAN_HPP
21#include "observable.hpp"
22#include "constant_cell.hpp"
23#include "computed.hpp"
24#include "store_cell.hpp"
39 template <
typename A,
typename B>
61 template <
typename A,
typename B>
67 return a.value() || b.value();
104 return condition.value() ? if_true.value() : if_false.value();
105 }, condition, if_true, if_false);
125 if (!condition.value()) {
129 return if_true.value();
130 }, condition, if_true)
149 return [&] (
const Cell auto &cond) {
170 return [&] (
const Cell auto &cond) {
Dynamically typed Cell container.
Definition observable.hpp:133
Concept specifying that T is either a Cell or a value that can be converted to a constant_cell.
Definition constant_cell.hpp:141
Defines the cell protocol.
Definition types.hpp:128
auto select(const Cell auto &if_true)
Create an Operator for conditionally selecting the value of another cell based on the value of the op...
Definition boolean.hpp:148
Definition boolean.hpp:26
auto operator!(const Cell auto &cell)
Create a cell that evaluates to the logical not of the value of a cell.
Definition boolean.hpp:79
constant_cell< T > value(const T &value)
Definition constant_cell.hpp:132
auto store(const C &arg)
Create a Cell that caches the value of another Cell.
Definition store_cell.hpp:206
auto computed(F &&compute)
Create a cell with a value that is a function of one or more argument cells.
Definition computed.hpp:45
auto select(Cell auto condition, Cell auto if_true, Cell auto if_false)
Create a cell which selects between the values of two cells based on the value of a condition cell.
Definition boolean.hpp:102
auto ensure_cell(const Cell auto &thing)
Ensure that thing is a Cell.
Definition constant_cell.hpp:155
auto operator&&(const A &a, const B &b)
Creates a Cell that evaluates to the logical and of the values of cells a and b.
Definition boolean.hpp:40
auto operator||(const A &a, const B &b)
Create a cell that evaluates to the logical or of the values of cells a and b.
Definition boolean.hpp:62
auto make_compute_cell(std::invocable auto f, auto... args)
Definition compute_cell.hpp:100