我想要的是类似这样的东西:
struct leaf_type {};
struct value_type {};
struct binary_tree
{
value_type val;
std::variant<binary_tree, leaf_type> left_branch;
std::variant<binary_tree, leaf_type> right_branch;
};
但 std::variant 其实不支持这种写法,
请问各位大佬这方面有什么最佳实践么?
struct leaf_type {};
struct value_type {};
struct binary_tree
{
value_type val;
std::variant<binary_tree, leaf_type> left_branch;
std::variant<binary_tree, leaf_type> right_branch;
};
但 std::variant 其实不支持这种写法,
请问各位大佬这方面有什么最佳实践么?