mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Update sqratArray.h
This commit is contained in:
parent
2b6ba1d4c1
commit
a72cc4fccf
@ -580,12 +580,13 @@ public:
|
||||
template<class F, class... A>
|
||||
ArrayBase& AppendFrom(F&& func, A &&... a) {
|
||||
HSQUIRRELVM vm = SqVM();
|
||||
const StackGuard sg(vm);
|
||||
sq_pushobject(vm, GetObj());
|
||||
while (func(vm, std::forward< A >(a)...))
|
||||
{
|
||||
sq_arrayappend(vm, -2);
|
||||
}
|
||||
sq_pop(vm,1); // pop array
|
||||
//sq_pop(vm,1); // pop array
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -602,12 +603,13 @@ public:
|
||||
template<class F, class... A>
|
||||
ArrayBase& AppendFromCounted(F&& func, A &&... a) {
|
||||
HSQUIRRELVM vm = SqVM();
|
||||
const StackGuard sg(vm);
|
||||
sq_pushobject(vm, GetObj());
|
||||
for (SQInteger i = 0; func(vm, i, std::forward< A >(a)...); ++i)
|
||||
{
|
||||
sq_arrayappend(vm, -2);
|
||||
}
|
||||
sq_pop(vm,1); // pop array
|
||||
//sq_pop(vm,1); // pop array
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user