This commit is contained in:
Michele Caini
2017-05-28 15:43:44 +02:00
parent 73501809b4
commit 6a5b0464d2
3 changed files with 8 additions and 4 deletions

View File

@@ -47,7 +47,7 @@ message("*")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wconversion")
# set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wextra -Weffc++")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DRELEASE")

View File

@@ -78,7 +78,7 @@ public:
reverse.resize(entity+1);
}
reverse[entity] = direct.size();
reverse[entity] = pos_type(direct.size());
direct.emplace_back(entity);
data.push_back({ args... });
@@ -124,7 +124,11 @@ public:
using size_type = typename Pool<Component>::size_type;
explicit ComponentPool(size_type dim = 4098) noexcept
#ifdef _MSC_VER
: ComponentPool<Entity, Component>{dim}, ComponentPool<Entity, Components>{dim}...
#else
: Pool<Component>{dim}, Pool<Components>{dim}...
#endif
{
assert(!(dim < 0));
}

View File

@@ -243,11 +243,11 @@ public:
Registry & operator=(Registry &&) = delete;
size_type size() const noexcept {
return static_cast<size_type>(count - available.size());
return count - available.size();
}
size_type capacity() const noexcept {
return static_cast<size_type>(count);
return count;
}
template<typename Comp>