Skip to content

Commit

Permalink
workaround for a wrong warning emitted by GCC8 (close skypjack#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Apr 30, 2019
1 parent c344f63 commit 1414c5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/entt/entity/registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class basic_registry {
this->construct(entt);
}
} else if constexpr(std::disjunction_v<std::is_same<Exclude, Component>...>) {
if((reg.pool<Get>()->has(entt) && ...) && !((!std::is_same_v<Exclude, Component> && reg.pool<Exclude>()->has(entt)) || ...)) {
if((reg.pool<Get>()->has(entt) && ...) && ((std::is_same_v<Exclude, Component> || !reg.pool<Exclude>()->has(entt)) && ...)) {
this->construct(entt);
}
}
Expand Down Expand Up @@ -154,7 +154,7 @@ class basic_registry {
} else if constexpr(std::disjunction_v<std::is_same<Exclude, Component>...>) {
if((std::get<pool_type<Owned> *>(cpools)->has(entt) && ...)
&& (reg.pool<Get>()->has(entt) && ...)
&& !((!std::is_same_v<Exclude, Component> && reg.pool<Exclude>()->has(entt)) || ...))
&& ((std::is_same_v<Exclude, Component> || !reg.pool<Exclude>()->has(entt)) && ...))
{
construct();
}
Expand Down
8 changes: 4 additions & 4 deletions test/entt/entity/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,14 @@ TEST(OwningGroup, ExcludedComponents) {
registry.assign<int>(e1, 1);
registry.assign<char>(e1);

const auto group = registry.group<int>(entt::exclude<char>);
const auto group = registry.group<int>(entt::exclude<char, double>);

const auto e2 = registry.create();
registry.assign<int>(e2, 2);

const auto e3 = registry.create();
registry.assign<int>(e3, 3);
registry.assign<char>(e3);
registry.assign<double>(e3);

for(const auto entity: group) {
if(entity == e0) {
Expand All @@ -836,12 +836,12 @@ TEST(OwningGroup, ExcludedComponents) {
}

registry.assign<char>(e0);
registry.assign<char>(e2);
registry.assign<double>(e2);

ASSERT_TRUE(group.empty());

registry.remove<char>(e1);
registry.remove<char>(e3);
registry.remove<double>(e3);

for(const auto entity: group) {
if(entity == e1) {
Expand Down

0 comments on commit 1414c5f

Please sign in to comment.