#include <boost/container/devector.hpp>
#ifdef NDEBUG
#undef NDEBUG
#endif
#include <cassert>
int main ()
{
using namespace boost::container;
typedef devector_options< stored_size<unsigned char> >::type size_option_t;
typedef devector<int, new_allocator<int>, size_option_t > size_optimized_devector_t;
assert(( sizeof(size_optimized_devector_t) < sizeof(devector<int>) ));
bool exception_thrown = false;
#ifndef BOOST_NO_EXCEPTIONS
BOOST_CONTAINER_TRY{ size_optimized_devector_t v(256); } BOOST_CONTAINER_CATCH(...){ exception_thrown = true; } BOOST_CONTAINER_CATCH_END
#else
exception_thrown = true;
#endif
assert(exception_thrown == true);
typedef devector_options< growth_factor<growth_factor_50> >::type growth_50_option_t;
devector<int, new_allocator<int>, growth_50_option_t > growth_50_dv(5, 0);
std::size_t old_cap = growth_50_dv.capacity();
growth_50_dv.resize(old_cap);
growth_50_dv.push_back(1);
assert(growth_50_dv.capacity() == old_cap*3/2);
typedef devector_options< relocate_on_66 >::type relocation_66_option_t;
devector<int, new_allocator<int>, relocation_66_option_t > reloc_66_dv
(16u, 16u, reserve_only_tag_t());
old_cap = reloc_66_dv.capacity();
const std::size_t front_free_cap = reloc_66_dv.front_free_capacity();
while (reloc_66_dv.back_free_capacity() > 0)
reloc_66_dv.push_back(0);
assert(reloc_66_dv.front_free_capacity() == front_free_cap);
reloc_66_dv.push_back(0);
assert(reloc_66_dv.capacity() == old_cap);
assert(reloc_66_dv.front_free_capacity() < front_free_cap);
while (reloc_66_dv.back_free_capacity() > 0)
reloc_66_dv.push_back(1);
reloc_66_dv.push_back(-1);
assert(reloc_66_dv.capacity() > old_cap);
return 0;
}