Skip to content

Commit 35c2c2d

Browse files
committed
Try composition instead of inheritance
1 parent 6f46e42 commit 35c2c2d

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

test/rvariant/truly_recursive_test.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,19 @@ struct NodeArray;
143143

144144
using Node = iris::rvariant<int, iris::recursive_wrapper<NodeArray>>;
145145

146-
struct NodeArray : std::vector<Node>
146+
struct NodeArray
147147
{
148-
using std::vector<Node>::vector;
148+
std::vector<Node> nodes;
149+
150+
bool operator==(NodeArray const& other) const
151+
{
152+
return nodes == other.nodes;
153+
}
154+
155+
auto operator<=>(NodeArray const& other) const
156+
{
157+
return nodes <=> other.nodes;
158+
}
149159
};
150160

151161
} // anonymous

0 commit comments

Comments
 (0)