CScriptSpecialFunction progress & symbol updates

Former-commit-id: 84d590be2f
This commit is contained in:
2022-10-04 20:16:03 -04:00
parent c8528fc2ee
commit e7ecda7a36
20 changed files with 234 additions and 152 deletions

View File

@@ -16,11 +16,21 @@ public:
optional_object(const T& item) : m_valid(true) { rstl::construct< T >(m_data, item); }
optional_object(const optional_object& other) : m_valid(other.m_valid) {
if (other.m_valid) {
rstl::construct< T >(m_data, other.data());
construct< T >(m_data, other.data());
}
}
~optional_object() { clear(); }
optional_object& operator=(const optional_object& other) {
if (this != &other) {
if (other.m_valid) {
assign(other.data());
} else {
clear();
}
}
return *this;
}
optional_object& operator=(const T& item) {
assign(item);
return *this;
@@ -40,7 +50,7 @@ public:
}
T& operator*() { return data(); }
T* operator->() { return data(); }
T* operator->() { return &data(); }
private:
u8 m_data[sizeof(T)];
@@ -48,7 +58,7 @@ private:
void assign(const T& item) {
if (!m_valid) {
rstl::construct(get_ptr(), item);
construct(get_ptr(), item);
m_valid = true;
} else {
data() = item;

View File

@@ -27,6 +27,8 @@ private:
node* mLeft;
node* mRight;
P mValue;
P& get_value() { return mValue; }
};
struct header {};
@@ -35,12 +37,12 @@ public:
node* mNode;
const header* mHeader;
const P* operator->() const { return &mNode->mValue; }
const P* operator->() const { return &mNode->get_value(); }
bool operator==(const const_iterator& other) const {
return mNode == other.mNode && mHeader == other.mHeader;
}
bool operator!=(const const_iterator& other) const {
return mNode != other.mNode || mHeader != other.mHeader;
return !(*this == other); // mNode != other.mNode || mHeader != other.mHeader;
}
};

View File

@@ -112,7 +112,15 @@ public:
protected:
template < typename In >
void insert_into(iterator it, int count, In in);
void insert_into(iterator at, int n, In in);/* {
int insertAt = xc_items + n;
if (x8_capacity < insertAt) {
int newCapacity = x8_capacity != 0 ? x8_capacity * 2 : 4;
T* newData;
x0_allocator.allocate(newData, newCapacity);
}
}*/
};
template < typename T, typename Alloc >