bump version + allocator rule of 5

v1
Brett 2023-12-18 23:24:53 -05:00
parent b59f4af8ed
commit 2440044d72
2 changed files with 39 additions and 5 deletions

View File

@ -178,6 +178,20 @@ namespace blt
allocate_block();
}
area_allocator(const area_allocator& copy) = delete;
area_allocator(area_allocator&& move)
{
blocks = move.blocks;
}
area_allocator& operator=(const area_allocator& copy) = delete;
area_allocator& operator=(area_allocator&& move)
{
std::swap(move.blocks, blocks);
}
[[nodiscard]] pointer allocate(size_t n)
{
if (n > BLOCK_SIZE)

View File

@ -6,21 +6,41 @@
#include <stdexcept>
#include <vector>
#include <blt/std/queue.h>
#include <blt/std/allocator.h>
#include <iostream>
#include <memory>
#ifndef BLT_BINARY_TREE_H
#define BLT_BINARY_TREE_H
namespace blt {
namespace blt
{
class binary_search_tree_error : public std::runtime_error {
class binary_search_tree_error : public std::runtime_error
{
public:
explicit binary_search_tree_error(const std::string& string): runtime_error(string) {}
explicit binary_search_tree_error(const std::string& string): runtime_error(string)
{}
};
template<typename T, typename alloc = blt::area_allocator<T>>
class AVL_node_tree
{
private:
struct node
{
node* left, right;
T val;
};
node* root = nullptr;
public:
AVL_node_tree() = default;
~AVL_node_tree()
{
}
};
}