[ox/std] Fix Vector for MSVC

This commit is contained in:
Gary Talent 2023-08-30 21:01:20 -05:00
parent cc0da5dd6a
commit 1a7e551025

View File

@ -357,13 +357,13 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
[[nodiscard]]
constexpr bool contains(const T&) const noexcept(useNoexcept);
constexpr iterator<> insert(
constexpr iterator<T&, T*, false> insert(
std::size_t pos, std::size_t cnt, const T &val) noexcept(useNoexcept);
constexpr iterator<> insert(std::size_t pos, const T &val) noexcept(useNoexcept);
constexpr iterator<T&, T*, false> insert(std::size_t pos, const T &val) noexcept(useNoexcept);
template<typename... Args>
constexpr iterator<> emplace(std::size_t pos, Args&&... args) noexcept(useNoexcept);
constexpr iterator<T&, T*, false> emplace(std::size_t pos, Args&&... args) noexcept(useNoexcept);
template<typename... Args>
constexpr T &emplace_back(Args&&... args) noexcept(useNoexcept);
@ -377,14 +377,14 @@ class Vector: detail::VectorAllocator<T, Allocator, SmallVectorSize> {
* @param pos iterator at the point to remove
* @return Error if index is out of bounds
*/
constexpr Result<iterator<>> erase(const iterator<> &pos) noexcept(useNoexcept);
constexpr Result<iterator<T&, T*, false>> erase(const iterator<> &pos) noexcept(useNoexcept);
/**
* Removes an item from the Vector.
* @param pos position of item to remove
* @return Error if index is out of bounds
*/
constexpr Result<iterator<>> erase(std::size_t pos) noexcept(useNoexcept);
constexpr Result<iterator<T&, T*, false>> erase(std::size_t pos) noexcept(useNoexcept);
/**
* Moves the last item in the Vector to position pos and decrements the
@ -595,7 +595,7 @@ constexpr bool Vector<T, SmallVectorSize, Allocator>::contains(const T &v) const
}
template<typename T, std::size_t SmallVectorSize, typename Allocator>
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<>
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false>
Vector<T, SmallVectorSize, Allocator>::insert(
std::size_t pos, std::size_t cnt, const T &val) noexcept(useNoexcept) {
if (m_size + cnt > m_cap) {
@ -624,7 +624,7 @@ Vector<T, SmallVectorSize, Allocator>::insert(
}
template<typename T, std::size_t SmallVectorSize, typename Allocator>
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<>
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false>
Vector<T, SmallVectorSize, Allocator>::insert(std::size_t pos, const T &val) noexcept(useNoexcept) {
if (m_size == m_cap) {
reserveInsert(m_cap ? m_cap * 2 : initialCap, pos);
@ -649,7 +649,7 @@ Vector<T, SmallVectorSize, Allocator>::insert(std::size_t pos, const T &val) noe
template<typename T, std::size_t SmallVectorSize, typename Allocator>
template<typename... Args>
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<>
constexpr typename Vector<T, SmallVectorSize, Allocator>::template iterator<T&, T*, false>
Vector<T, SmallVectorSize, Allocator>::emplace(std::size_t pos, Args&&... args) noexcept(useNoexcept) {
if (m_size == m_cap) {
reserveInsert(m_cap ? m_cap * 2 : initialCap, pos);