Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/fix warning conversion erase if #55

Merged
Merged
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.14)

project(amc
VERSION 2.5.0
VERSION 2.5.1
DESCRIPTION "Header base library of C++ containers"
LANGUAGES CXX
)
Expand Down
12 changes: 6 additions & 6 deletions include/amc/vectorcommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,18 +1497,18 @@ class Vector : public vec::VectorWithInplaceStorage<T, Alloc, SizeType, GrowingP
#ifdef AMC_CXX20
template <class V>
friend size_type erase(Vector &c, const V &value) {
auto it = std::remove(c.begin(), c.end(), value);
auto r = std::distance(it, c.end());
const auto it = std::remove(c.begin(), c.end(), value);
const auto r = std::distance(it, c.end());
c.erase(it, c.end());
return r;
return static_cast<size_type>(r);
}

template <class Pred>
friend size_type erase_if(Vector &c, Pred pred) {
auto it = std::remove_if(c.begin(), c.end(), pred);
auto r = std::distance(it, c.end());
const auto it = std::remove_if(c.begin(), c.end(), pred);
const auto r = std::distance(it, c.end());
c.erase(it, c.end());
return r;
return static_cast<size_type>(r);
}
#endif
};
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (NOT GTest_FOUND)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
GIT_TAG v1.14.0
)

# For Windows: Prevent overriding the parent project's compiler/linker settings
Expand Down Expand Up @@ -54,4 +54,4 @@ add_unit_test(
add_unit_test(
sets_test
sets_test.cpp
)
)
Loading