diff --git a/Entities.hpp b/Entities.hpp index 853262a..5b65262 100644 --- a/Entities.hpp +++ b/Entities.hpp @@ -216,9 +216,9 @@ namespace rage template void Call(const std::string& eventName, Args&&... args) { - const int count = sizeof...(Args); + constexpr auto count = sizeof...(args); - if constexpr(count == 0) + if constexpr (count == 0) this->_Call(eventName); else { @@ -230,9 +230,9 @@ namespace rage template void Invoke(uint64_t hash, Args&&... args) { - const int count = sizeof...(Args); + constexpr auto count = sizeof...(args); - if constexpr(count == 0) + if constexpr (count == 0) this->_Invoke(hash); else { diff --git a/Pools.hpp b/Pools.hpp index 3174a86..dc07695 100644 --- a/Pools.hpp +++ b/Pools.hpp @@ -32,9 +32,9 @@ namespace rage template void Call(const std::string& eventName, Args&&... args) { - const int count = sizeof...(Args); + constexpr auto count = sizeof...(args); - if (count == 0) + if constexpr (count == 0) this->_Call(eventName); else { @@ -46,9 +46,9 @@ namespace rage template void CallInRange(const vector3& position, float range, dimensionId_t dimension, const std::string& eventName, Args&&... args) { - const int count = sizeof...(Args); + constexpr auto count = sizeof...(args); - if (count == 0) + if constexpr (count == 0) this->_CallInRange(position, range, dimension, eventName); else { @@ -60,9 +60,9 @@ namespace rage template void CallInDimension(dimensionId_t dimension, const std::string& eventName, Args&&... args) { - const int count = sizeof...(Args); + constexpr auto count = sizeof...(args); - if (count == 0) + if constexpr (count == 0) this->_CallInDimension(dimension, eventName); else { @@ -74,9 +74,9 @@ namespace rage template void Invoke(uint64_t hash, Args&&... args) { - const int count = sizeof...(Args); + constexpr auto count = sizeof...(args); - if (count == 0) + if constexpr (count == 0) this->_Invoke(hash); else { @@ -88,9 +88,9 @@ namespace rage template void InvokeInRange(const vector3& position, float range, dimensionId_t dimension, uint64_t hash, Args&&... args) { - const int count = sizeof...(Args); + constexpr auto count = sizeof...(args); - if (count == 0) + if constexpr (count == 0) this->_InvokeInRange(position, range, dimension, hash); else { @@ -102,9 +102,9 @@ namespace rage template void InvokeInDimension(dimensionId_t dimension, uint64_t hash, Args&&... args) { - const int count = sizeof...(Args); + constexpr auto count = sizeof...(args); - if (count == 0) + if constexpr (count == 0) this->_InvokeInDimension(dimension, hash); else {