From fd810237c381b5ad1966cad6594c1506a6c7e607 Mon Sep 17 00:00:00 2001 From: Alexander McCord Date: Sun, 2 Jun 2024 18:35:38 -0700 Subject: [PATCH] Make operands be usable in const context. --- EqSat/include/Luau/Language.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/EqSat/include/Luau/Language.h b/EqSat/include/Luau/Language.h index e32d76cc..972737ce 100644 --- a/EqSat/include/Luau/Language.h +++ b/EqSat/include/Luau/Language.h @@ -87,6 +87,11 @@ public: return {}; } + Slice operands() const + { + return {}; + } + bool operator==(const Atom& rhs) const { return _value == rhs._value; @@ -126,7 +131,12 @@ struct NodeVector public: Slice operands() { - return {vector.data(), vector.size()}; + return Slice{vector.data(), vector.size()}; + } + + Slice operands() const + { + return Slice{vector.data(), vector.size()}; } bool operator==(const NodeVector& rhs) const @@ -193,6 +203,11 @@ public: return Slice{array}; } + Slice operands() const + { + return Slice{array}; + } + template const Id& field() const { @@ -306,7 +321,7 @@ public: template Language(T&& t, std::enable_if_t::value>* = 0) noexcept { - tag = T::tag; + tag = std::decay_t::tag; new (&buffer) std::decay_t(std::forward(t)); }