diff --git a/include/boost/container/detail/utilities.hpp b/include/boost/container/detail/utilities.hpp index f56c3bf..b1abc48 100644 --- a/include/boost/container/detail/utilities.hpp +++ b/include/boost/container/detail/utilities.hpp @@ -183,12 +183,74 @@ struct are_elements_contiguous static const bool value = false; }; +///////////////////////// +// raw pointers +///////////////////////// + template struct are_elements_contiguous { static const bool value = true; }; +///////////////////////// +// predeclarations +///////////////////////// + +#ifndef BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +template +class vector_iterator; + +template +class vector_const_iterator; + +#endif //BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +} //namespace container_detail { +} //namespace container { + +namespace interprocess { + +template +class offset_ptr; + +} //namespace interprocess { + +namespace container { + +namespace container_detail { + +///////////////////////// +//vector_[const_]iterator +///////////////////////// + +#ifndef BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +template +struct are_elements_contiguous > +{ + static const bool value = true; +}; + +template +struct are_elements_contiguous > +{ + static const bool value = true; +}; + +#endif //BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER + +///////////////////////// +// offset_ptr +///////////////////////// + +template +struct are_elements_contiguous< ::boost::interprocess::offset_ptr > +{ + static const bool value = true; +}; + template struct are_contiguous_and_same { diff --git a/test/vector_test.hpp b/test/vector_test.hpp index aba9ee4..bbcffb1 100644 --- a/test/vector_test.hpp +++ b/test/vector_test.hpp @@ -83,6 +83,11 @@ bool vector_copyable_only(V1 *boostvector, V2 *stdvector, boost::container::cont { V1 *pv1 = new V1(*boostvector); V2 *pv2 = new V2(*stdvector); + boostvector->clear(); + stdvector->clear(); + boostvector->assign(pv1->begin(), pv1->end()); + stdvector->assign(pv2->begin(), pv2->end()); + if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; delete pv1; delete pv2; }