mirror of
https://github.com/boostorg/container.git
synced 2026-01-29 09:50:22 +01:00
Fixes #206 ("operator-> on static_vector::iterator causes cast alignment warning")
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user