mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-24 05:14:40 -04:00
fix macos build
- add initializer_list constructor to `gd::vector`
This commit is contained in:
parent
662a9e99f5
commit
38bebd67cd
1 changed files with 9 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <variant> // for std::monostate
|
||||
#include <algorithm>
|
||||
#include <Geode/platform/platform.hpp>
|
||||
|
||||
//#include "../utils/platform.hpp"
|
||||
|
@ -305,6 +306,14 @@ namespace gd {
|
|||
}
|
||||
}
|
||||
|
||||
vector(std::initializer_list<T> const& input) {
|
||||
auto tmp = new T[input.size()];
|
||||
m_start = tmp;
|
||||
m_finish = m_start + input.size();
|
||||
m_capacity_end = m_start + input.size();
|
||||
std::copy(input.begin(), input.end(), std::begin(tmp));
|
||||
}
|
||||
|
||||
T& front() {
|
||||
return *m_start;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue