diff --git a/data_structures/binary_search_tree.h b/data_structures/binary_search_tree.h deleted file mode 100644 index 2292893..0000000 --- a/data_structures/binary_search_tree.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -namespace Ariana -{ - -template -struct BST -{ - -}; - -}; // namespace \ No newline at end of file diff --git a/data_structures/pair.h b/data_structures/pair.h deleted file mode 100644 index 0b3795e..0000000 --- a/data_structures/pair.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -namespace Ariana -{ - -template -struct Pair -{ - -}; - -}; // namespace \ No newline at end of file diff --git a/data_structures/tensor.h b/data_structures/tensor.h deleted file mode 100644 index 57bf3cd..0000000 --- a/data_structures/tensor.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -namespace Ariana -{ - -template -struct Tensor // multy dimensional array -{ - -}; - -}; // namespace \ No newline at end of file diff --git a/data_structures/tuple.h b/data_structures/tuple.h deleted file mode 100644 index d999b21..0000000 --- a/data_structures/tuple.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -namespace Ariana -{ - -template -struct Tuple -{ - -}; - -}; // namespace \ No newline at end of file diff --git a/data_structures/vector.h b/data_structures/vector.h deleted file mode 100644 index b8ac6ff..0000000 --- a/data_structures/vector.h +++ /dev/null @@ -1,152 +0,0 @@ -#pragma once -#include -#include - -namespace Ariana -{ - -template // generic structure -struct Vector // dynamic array -{ - private: - - T* m_elements; - std::size_t m_capacity; - std::size_t m_size; - - class Iterator; // forward declartion - - void allocate(); - - void deallocate(); - - public: - - Vector(); - - Vector(const std::size_t cap); - - Vector(const std::initializer_list& list); - - Vector(const Ariana::Vector& other); - - ~Vector(); - - T& operator[](const std::size_t index) const; - - Ariana::Vector& operator=(const std::initializer_list& list); - - Ariana::Vector& operator=(const Ariana::Vector& other); // assignment chaining - - void emplace(); - - void emplace_back(); - - void push_back(); - - void pop_back(); - - void insert(); - - void erase(); - - size_t capacity() const; - - size_t size() const; - - T& front() const; - - T& back() const; - - Iterator begin() const; - - Iterator end() const; -}; - -template -Vector::Vector(): m_size(0), m_capacity(1) { - m_elements = new T[m_capacity]; -} - -template -Vector::Vector(const std::size_t cap): m_size(0), m_capacity(cap) { - m_elements = new T[m_capacity]; -} - -template -Vector::Vector(const std::initializer_list& list): m_size(list.size()), m_capacity(list.size()) { - m_elements = new T[m_capacity]; - for (int i = 0; i < list.size(); i++) { - m_elements[i] = list[i]; - } -} - -template -Vector::Vector(const Vector& other): m_size(other.size()), m_capacity(other.size()) { - m_elements = new T[m_capacity]; - for (int i = 0; i < other.size(); i++) { - m_elements[i] = other[i]; - } -} - -template -Vector::~Vector() { - delete[] m_elements; -} - -template -T& Vector::operator[](const std::size_t index) const { - return *(m_elements + index); // m_elements[index] -} - -template -Vector& Vector::operator=(const std::initializer_list& list) { - - return *this; -} - -template -Vector& Vector::operator=(const Ariana::Vector& other) { - if (this != &other) { // self assignment - - } - return *this; -} - -template -size_t Vector::capacity() const { - return m_capacity; -} - -template -size_t Vector::size() const { - return m_size; -} - -template -T& Vector::front() const { - return m_elements[0]; -} - -template -T& Vector::back() const { - return m_elements[m_size-1]; -} - -template -Vector::Iterator Vector::begin() const { - -} - -template -Vector::Iterator Vector::end() const { - -} - -template -class Vector::Iterator -{ - -}; - -}; // namespace \ No newline at end of file