summaryrefslogtreecommitdiff
path: root/boost/align/aligned_allocator_adaptor.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/align/aligned_allocator_adaptor.hpp')
-rw-r--r--boost/align/aligned_allocator_adaptor.hpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/boost/align/aligned_allocator_adaptor.hpp b/boost/align/aligned_allocator_adaptor.hpp
index b6ddd9c369..8905c215d3 100644
--- a/boost/align/aligned_allocator_adaptor.hpp
+++ b/boost/align/aligned_allocator_adaptor.hpp
@@ -1,10 +1,9 @@
/*
-(c) 2014-2016 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
+Copyright 2014-2016 Glen Joseph Fernandes
+(glenjofe@gmail.com)
-Distributed under the Boost Software
-License, Version 1.0.
-http://boost.org/LICENSE_1_0.txt
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_HPP
#define BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_HPP
@@ -123,7 +122,8 @@ public:
char_ptr p = a.allocate(sizeof p + n);
void* r = detail::addressof(*p) + sizeof p;
(void)align(min_align, s, r, n);
- ::new((void*)(static_cast<char_ptr*>(r) - 1)) char_ptr(p);
+ ::new(static_cast<void*>(static_cast<char_ptr*>(r)
+ - 1)) char_ptr(p);
return static_cast<pointer>(r);
}
@@ -142,12 +142,13 @@ public:
#endif
void* r = detail::addressof(*p) + sizeof p;
(void)align(min_align, s, r, n);
- ::new((void*)(static_cast<char_ptr*>(r) - 1)) char_ptr(p);
+ ::new(static_cast<void*>(static_cast<char_ptr*>(r)
+ - 1)) char_ptr(p);
return static_cast<pointer>(r);
}
void deallocate(pointer ptr, size_type size) {
- char_ptr* p = (char_ptr*)ptr - 1;
+ char_ptr* p = reinterpret_cast<char_ptr*>(ptr) - 1;
char_ptr r = *p;
p->~char_ptr();
char_alloc a(base());
@@ -156,23 +157,23 @@ public:
}
};
-template<class A1, class A2, std::size_t Alignment>
-inline bool operator==(const aligned_allocator_adaptor<A1,
- Alignment>& a, const aligned_allocator_adaptor<A2,
- Alignment>& b) BOOST_NOEXCEPT
+template<class A, class B, std::size_t Alignment>
+inline bool
+operator==(const aligned_allocator_adaptor<A, Alignment>& a,
+ const aligned_allocator_adaptor<B, Alignment>& b) BOOST_NOEXCEPT
{
return a.base() == b.base();
}
-template<class A1, class A2, std::size_t Alignment>
-inline bool operator!=(const aligned_allocator_adaptor<A1,
- Alignment>& a, const aligned_allocator_adaptor<A2,
- Alignment>& b) BOOST_NOEXCEPT
+template<class A, class B, std::size_t Alignment>
+inline bool
+operator!=(const aligned_allocator_adaptor<A, Alignment>& a,
+ const aligned_allocator_adaptor<B, Alignment>& b) BOOST_NOEXCEPT
{
return !(a == b);
}
-} /* .alignment */
-} /* .boost */
+} /* alignment */
+} /* boost */
#endif