We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This construction leads to assert:
auto it = v.begin(); // empty vector it += 0; // <---- assert here
See also b56cbb6 Full code:
#include <boost/container/vector.hpp> #include <vector> #include <assert.h> #define TEST_ASSERT(x) assert((x)) typedef int StorableType; typedef std::vector<StorableType> StdVector; typedef boost::container::vector<StorableType> BoostVector; template<typename Vector> void insertToPosition(Vector& v,size_t pos,StorableType val) { auto it = v.begin(); it += pos; v.insert(it,val); } template<typename Vector> void test() { // insert to begin and non empty { Vector v = {11,12}; insertToPosition(v,0,10); TEST_ASSERT((v == Vector{10,11,12})); } // insert to empty { Vector v; insertToPosition(v,0,10); TEST_ASSERT((v == Vector{10})); } } int main() { test<StdVector>(); test<BoostVector>(); return 0; }
The text was updated successfully, but these errors were encountered:
Please, can you give more detailed description about that issue?
Sorry, something went wrong.
If you run this code then
test<BoostVector>();
call will give you boost assert.
test<StdVector>();
runs without assert.
Fix GitHub #83: ("Iterator zero incrementing leads to assert on empty…
10a618a
… vector")
Many thanks for the report. Fixed in the following commit, to be released in Boost 1.69:
No branches or pull requests
This construction leads to assert:
See also b56cbb6
Full code:
The text was updated successfully, but these errors were encountered: