Fixes #206 ("operator-> on static_vector::iterator causes cast alignment warning")

This commit is contained in:
Ion Gaztañaga
2021-12-28 15:17:15 +01:00
parent ea3521bf14
commit 3f76f9fdf7
23 changed files with 124 additions and 93 deletions

View File

@@ -22,6 +22,7 @@ volatile ::boost::container::vector<empty> dummy;
#include <boost/container/allocator.hpp>
#include "movable_int.hpp"
#include "dummy_test_allocator.hpp"
#include <boost/move/detail/force_ptr.hpp>
class CustomAllocator
{
@@ -33,7 +34,7 @@ class CustomAllocator
typedef short difference_type;
pointer allocate(size_type count)
{ return (pointer)new char[sizeof(value_type)*count]; }
{ return boost::move_detail::force_ptr<pointer>(new char[sizeof(value_type)*count]); }
void deallocate(pointer ptr, size_type )
{ delete [](char*)ptr; }