添加外部内存数据源

This commit is contained in:
2026-08-04 18:14:38 +08:00
parent f1b9cadd47
commit 44aa60f816
23 changed files with 500 additions and 105 deletions
@@ -1,12 +1,14 @@
#pragma once
#include <algorithm>
#include <cstddef>
#include <memory_resource>
#include <stdexcept>
#include <vector>
template <class Owner, class Tag = void>
class Multiway_Node {
public:
explicit Multiway_Node(Owner* owner = nullptr) noexcept : owner(owner) {}
explicit Multiway_Node(Owner* owner = nullptr, std::pmr::memory_resource& memory_resource = *std::pmr::get_default_resource()) noexcept
: owner(owner), children(&memory_resource) {}
Multiway_Node(const Multiway_Node&) = delete;
Multiway_Node& operator=(const Multiway_Node&) = delete;
Multiway_Node(Multiway_Node&&) = delete;
@@ -45,5 +47,5 @@ public:
}
Owner* owner{};
Multiway_Node* parent{};
std::vector<Multiway_Node*> children;
std::pmr::vector<Multiway_Node*> children;
};