diff options
Diffstat (limited to 'boost/align/aligned_allocator.hpp')
-rw-r--r-- | boost/align/aligned_allocator.hpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/boost/align/aligned_allocator.hpp b/boost/align/aligned_allocator.hpp index 6176bc27c0..4ec6b50c2f 100644 --- a/boost/align/aligned_allocator.hpp +++ b/boost/align/aligned_allocator.hpp @@ -41,13 +41,6 @@ public: typedef T& reference; typedef const T& const_reference; -private: - enum { - min_align = detail::max_size<Alignment, - alignment_of<value_type>::value>::value - }; - -public: template<class U> struct rebind { typedef aligned_allocator<U, Alignment> other; @@ -72,10 +65,14 @@ public: } pointer allocate(size_type size, const_void_pointer = 0) { + enum { + m = detail::max_size<Alignment, + alignment_of<value_type>::value>::value + }; if (size == 0) { return 0; } - void* p = aligned_alloc(min_align, sizeof(T) * size); + void* p = boost::alignment::aligned_alloc(m, sizeof(T) * size); if (!p) { boost::throw_exception(std::bad_alloc()); } |