Fix array class

This commit is contained in:
Federico Cecchetto
2021-07-11 17:11:15 +02:00
parent cb0725bad1
commit 9ed8626067
3 changed files with 101 additions and 10 deletions

View File

@ -49,15 +49,15 @@ namespace scripting
return get<T>();
}
template <typename T>
template <typename T, typename I = int>
T* as_ptr()
{
if (!this->is<int>())
if (!this->is<I>())
{
throw std::runtime_error("Invalid type");
}
const auto value = this->get<int>();
const auto value = this->get<I>();
if (!value)
{