bump version + allocator rule of 5
parent
b59f4af8ed
commit
2440044d72
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue