[nostalgia/std] Add String as alternative to BString, which uses heap allocations
This commit is contained in:
8
deps/ox/src/ox/std/vector.hpp
vendored
8
deps/ox/src/ox/std/vector.hpp
vendored
@ -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++) {
|
||||
|
Reference in New Issue
Block a user