Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Entities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ namespace rage
template<typename ...Args>
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
{
Expand All @@ -230,9 +230,9 @@ namespace rage
template<typename ...Args>
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
{
Expand Down
24 changes: 12 additions & 12 deletions Pools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ namespace rage
template<typename ...Args>
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
{
Expand All @@ -46,9 +46,9 @@ namespace rage
template<typename ...Args>
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
{
Expand All @@ -60,9 +60,9 @@ namespace rage
template<typename ...Args>
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
{
Expand All @@ -74,9 +74,9 @@ namespace rage
template<typename ...Args>
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
{
Expand All @@ -88,9 +88,9 @@ namespace rage
template<typename ...Args>
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
{
Expand All @@ -102,9 +102,9 @@ namespace rage
template<typename ...Args>
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
{
Expand Down