[nostalgia/std] Add String as alternative to BString, which uses heap allocations

This commit is contained in:
2020-03-14 16:30:14 -05:00
parent 317cfabc72
commit 38acb5dfc3
8 changed files with 368 additions and 157 deletions

View File

@ -8,6 +8,7 @@
#pragma once
#include "new.hpp"
#include "types.hpp"
#include "utility.hpp"
@ -54,6 +55,8 @@ class Vector {
T *data();
const T *data() const;
bool contains(T) const noexcept;
template<typename... Args>
@ -197,6 +200,11 @@ T *Vector<T>::data() {
return m_items;
}
template<typename T>
const T *Vector<T>::data() const {
return m_items;
}
template<typename T>
bool Vector<T>::contains(T v) const noexcept {
for (std::size_t i = 0; i < m_size; i++) {