summaryrefslogtreecommitdiff
path: root/c++/core/tree.h
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2023-12-01 16:12:57 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2023-12-01 16:12:57 +0100
commit35e76eac52d5fbb370ddb92810d7daf4ea684beb (patch)
treecfb6f3bc58c7de48368721f74e6667a9b54c7286 /c++/core/tree.h
parent031ec5a012d43854a581263d84a8d90bb26896c2 (diff)
core: Experimental changes to tree and mcts
Diffstat (limited to 'c++/core/tree.h')
-rw-r--r--c++/core/tree.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/c++/core/tree.h b/c++/core/tree.h
index 6316a5e..32572fc 100644
--- a/c++/core/tree.h
+++ b/c++/core/tree.h
@@ -25,7 +25,8 @@ private:
/**
* Object holding the treeed branch instances
*/
- std::vector<branch<T>> children_;
+ using branch = std::variant<T, tree<T>>;
+ std::vector<branch> children_;
public:
/**
* Default constructor
@@ -101,14 +102,14 @@ public:
/**
* Returns the branch at i
*/
- branch<T>& at(std::size_t i){
+ branch& at(std::size_t i){
return children_.at(i);
}
/**
* Returns the branch at i
*/
- const branch<T>& at(std::size_t i) const {
+ const branch& at(std::size_t i) const {
return children_.at(i);
}
};