Skip to content

Commit

Permalink
explicitly declare some accesses of templated base member functions "…
Browse files Browse the repository at this point in the history
…template"
  • Loading branch information
florianessl committed May 24, 2024
1 parent 746f412 commit 4e779fc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/game_scoped_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ inline bool Game_DataStorage_TPL::ShouldWarn(int first_id, int last_id) const {
ASSERT_IS_GLOBAL_SCOPE(S, "ShouldWarn");

if constexpr (storage_mode == VarStorage::eStorageMode_Vector) {
return (first_id <= 0 || last_id > this->GetSizeWithLimit<S>()) && (_warnings > 0);
return (first_id <= 0 || last_id > this->template GetSizeWithLimit<S>()) && (_warnings > 0);
}
return (first_id <= 0 && _warnings > 0);
}
Expand All @@ -625,13 +625,13 @@ inline bool Game_DataStorage_TPL::scopedShouldWarn(int first_id, int last_id, in
ASSERT_IS_VARIABLE_SCOPE(S, "scopedShouldWarn");

if constexpr (DynamicScope::IsFrameScope(S)) {
return first_id <= 0 || last_id > this->GetLimit<S>();
return first_id <= 0 || last_id > this->template GetLimit<S>();
} else if constexpr (storage_mode == VarStorage::eStorageMode_Vector) {
if constexpr (DynamicScope::IsMapScope(S)) {
return (map_id <= 0 || first_id <= 0 || last_id > this->GetLimit<S>()) && (_warnings > 0);
return (map_id <= 0 || first_id <= 0 || last_id > this->template GetLimit<S>()) && (_warnings > 0);
}
if constexpr (DynamicScope::IsMapEventScope(S)) {
return (map_id <= 0 || event_id <= 0 || first_id <= 0 || last_id > this->GetLimit<S>()) && (_warnings > 0);
return (map_id <= 0 || event_id <= 0 || first_id <= 0 || last_id > this->template GetLimit<S>()) && (_warnings > 0);
}
} else {
if constexpr (DynamicScope::IsMapScope(S)) {
Expand All @@ -652,7 +652,7 @@ void Game_DataStorage_TPL::PerformRangeOperation(const int first_id, const int l
if constexpr (sizeof...(Args) == 0) {
ASSERT_IS_GLOBAL_SCOPE(S, "PerformRangeOperation");

auto& storage = this->GetStorageForEdit<S>();
auto& storage = this->template GetStorageForEdit<S>();
for (int i = std::max(1, first_id); i <= last_id; ++i) {
if constexpr (std::is_same<V, bool>::value) {
bool v = storage.vector_ref()[i - 1];
Expand All @@ -665,7 +665,7 @@ void Game_DataStorage_TPL::PerformRangeOperation(const int first_id, const int l
}
} else if constexpr (DynamicScope::IsFrameScope(S)) {
std::vector<int32_t>& vec = GetFrameStorageForEdit(args...);
int hardcapped_last_id = std::min(last_id, static_cast<int>(GetLimit<S>()));
int hardcapped_last_id = std::min(last_id, static_cast<int>(this->template GetLimit<S>()));

for (int i = std::max(0, first_id); i < hardcapped_last_id; ++i) {
if constexpr (std::is_same<V, bool>::value) {
Expand All @@ -686,7 +686,7 @@ void Game_DataStorage_TPL::PerformRangeOperation(const int first_id, const int l
} else {
ASSERT_IS_VARIABLE_SCOPE(S, "PerformRangeOperation");

auto& storage = this->GetScopedStorageForEdit<S>(true, args...);
auto& storage = this->template GetScopedStorageForEdit<S>(true, args...);
for (int i = std::max(1, first_id); i <= last_id; ++i) {
if constexpr (std::is_same<V, bool>::value) {
bool v = storage.vector_ref()[i - 1];
Expand Down Expand Up @@ -771,7 +771,7 @@ SCOPED_IMPL inline V Game_DataStorage_TPL::Get(int id, Args... args) const {
if (EP_UNLIKELY(ShouldWarn<S>(id, id))) {
WarnGet<S>(id, 0, 0);
}
const Data_t& storage = this->GetStorage<S>();
const Data_t& storage = this->template GetStorage<S>();
if (!storage.containsKey(id))
return false;
return storage[id];
Expand Down Expand Up @@ -827,7 +827,7 @@ inline auto Game_DataStorage_TPL::FormatRValue(V v, const char* operandType, Dat
//special handling for string storage
if constexpr (std::is_same<V, std::string>::value) {
auto str = static_cast<std::string>(v);
if (str && str.length() > 8)
if (str.length() > 8)
v = str.substr(0, 5) + "...";
}

Expand Down

0 comments on commit 4e779fc

Please sign in to comment.