[ox/std] Add std::allocator

This commit is contained in:
Gary Talent 2021-11-06 12:55:28 -05:00
parent 2bcea545f5
commit 6bee2d12d7

View File

@ -8,8 +8,33 @@
#pragma once
#if __has_include(<memory>)
#include <memory>
#else
namespace std {
template<class T>
struct allocator {
[[nodiscard]]
constexpr T *allocate(size_t n) {
return static_cast<T*>(::operator new(n * sizeof(T)));
}
constexpr void deallocate(T *p, std::size_t) {
::operator delete(p);
}
};
}
#endif
#include "utility.hpp"
namespace ox {
template<typename T>