diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:30:07 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:32:57 +0900 |
commit | 71d216b90256936a9638f325af9bc69d720e75de (patch) | |
tree | 9c5f682d341c7c88ad0c8e3d4b262e00b6fb691a /boost/align | |
parent | 733b5d5ae2c5d625211e2985ac25728ac3f54883 (diff) | |
download | boost-71d216b90256936a9638f325af9bc69d720e75de.tar.gz boost-71d216b90256936a9638f325af9bc69d720e75de.tar.bz2 boost-71d216b90256936a9638f325af9bc69d720e75de.zip |
Imported Upstream version 1.59.0
Change-Id: I2dde00f4eca71df3eea9d251dcaecde18a6c90a5
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/align')
42 files changed, 996 insertions, 815 deletions
diff --git a/boost/align/align.hpp b/boost/align/align.hpp index 1600a243c0..b95d673bcd 100644 --- a/boost/align/align.hpp +++ b/boost/align/align.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGN_HPP #define BOOST_ALIGN_ALIGN_HPP diff --git a/boost/align/aligned_alloc.hpp b/boost/align/aligned_alloc.hpp index 1e4f2b783b..0e3ba60641 100644 --- a/boost/align/aligned_alloc.hpp +++ b/boost/align/aligned_alloc.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNED_ALLOC_HPP #define BOOST_ALIGN_ALIGNED_ALLOC_HPP diff --git a/boost/align/aligned_allocator.hpp b/boost/align/aligned_allocator.hpp index 114e37bb1c..a31dfe599f 100644 --- a/boost/align/aligned_allocator.hpp +++ b/boost/align/aligned_allocator.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_HPP #define BOOST_ALIGN_ALIGNED_ALLOCATOR_HPP @@ -26,143 +26,141 @@ #endif namespace boost { - namespace alignment { - template<class T, std::size_t Alignment> - class aligned_allocator { - BOOST_STATIC_ASSERT(detail:: - is_alignment_constant<Alignment>::value); - - public: - typedef T value_type; - typedef T* pointer; - typedef const T* const_pointer; - typedef void* void_pointer; - typedef const void* const_void_pointer; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef T& reference; - typedef const T& const_reference; - - private: - typedef detail::max_align<Alignment, - alignment_of<value_type>::value> MaxAlign; - - public: - template<class U> - struct rebind { - typedef aligned_allocator<U, Alignment> other; - }; +namespace alignment { + +template<class T, std::size_t Alignment> +class aligned_allocator { + BOOST_STATIC_ASSERT(detail:: + is_alignment_constant<Alignment>::value); + +public: + typedef T value_type; + typedef T* pointer; + typedef const T* const_pointer; + typedef void* void_pointer; + typedef const void* const_void_pointer; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef T& reference; + typedef const T& const_reference; + +private: + enum { + min_align = detail::max_align<Alignment, + alignment_of<value_type>::value>::value + }; + +public: + template<class U> + struct rebind { + typedef aligned_allocator<U, Alignment> other; + }; #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) - aligned_allocator() - BOOST_NOEXCEPT = default; + aligned_allocator() BOOST_NOEXCEPT = default; #else - aligned_allocator() - BOOST_NOEXCEPT { - } + aligned_allocator() BOOST_NOEXCEPT { + } #endif - template<class U> - aligned_allocator(const aligned_allocator<U, - Alignment>&) BOOST_NOEXCEPT { - } - - pointer address(reference value) const - BOOST_NOEXCEPT { - return detail::addressof(value); - } - - const_pointer address(const_reference value) const - BOOST_NOEXCEPT { - return detail::addressof(value); - } - - pointer allocate(size_type size, - const_void_pointer = 0) { - void* p = aligned_alloc(MaxAlign::value, - sizeof(T) * size); - if (!p && size > 0) { - boost::throw_exception(std::bad_alloc()); - } - return static_cast<T*>(p); - } - - void deallocate(pointer ptr, size_type) { - alignment::aligned_free(ptr); - } - - BOOST_CONSTEXPR size_type max_size() const - BOOST_NOEXCEPT { - return detail::max_count_of<T>::value; - } + template<class U> + aligned_allocator(const aligned_allocator<U, Alignment>&) + BOOST_NOEXCEPT { + } + + pointer address(reference value) const BOOST_NOEXCEPT { + return detail::addressof(value); + } + + const_pointer address(const_reference value) const + BOOST_NOEXCEPT { + return detail::addressof(value); + } + + pointer allocate(size_type size, const_void_pointer = 0) { + void* p = aligned_alloc(min_align, sizeof(T) * size); + if (!p && size > 0) { + boost::throw_exception(std::bad_alloc()); + } + return static_cast<T*>(p); + } + + void deallocate(pointer ptr, size_type) { + alignment::aligned_free(ptr); + } + + BOOST_CONSTEXPR size_type max_size() const BOOST_NOEXCEPT { + return detail::max_count_of<T>::value; + } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template<class U, class... Args> - void construct(U* ptr, Args&&... args) { - void* p = ptr; - ::new(p) U(std::forward<Args>(args)...); - } + template<class U, class... Args> + void construct(U* ptr, Args&&... args) { + void* p = ptr; + ::new(p) U(std::forward<Args>(args)...); + } #else - template<class U, class V> - void construct(U* ptr, V&& value) { - void* p = ptr; - ::new(p) U(std::forward<V>(value)); - } + template<class U, class V> + void construct(U* ptr, V&& value) { + void* p = ptr; + ::new(p) U(std::forward<V>(value)); + } #endif #else - template<class U, class V> - void construct(U* ptr, const V& value) { - void* p = ptr; - ::new(p) U(value); - } + template<class U, class V> + void construct(U* ptr, const V& value) { + void* p = ptr; + ::new(p) U(value); + } #endif - template<class U> - void construct(U* ptr) { - void* p = ptr; - ::new(p) U(); - } - - template<class U> - void destroy(U* ptr) { - (void)ptr; - ptr->~U(); - } - }; - - template<std::size_t Alignment> - class aligned_allocator<void, Alignment> { - BOOST_STATIC_ASSERT(detail:: - is_alignment_constant<Alignment>::value); - - public: - typedef void value_type; - typedef void* pointer; - typedef const void* const_pointer; - - template<class U> - struct rebind { - typedef aligned_allocator<U, Alignment> other; - }; - }; - - template<class T1, class T2, std::size_t Alignment> - inline bool operator==(const aligned_allocator<T1, - Alignment>&, const aligned_allocator<T2, - Alignment>&) BOOST_NOEXCEPT - { - return true; - } + template<class U> + void construct(U* ptr) { + void* p = ptr; + ::new(p) U(); + } - template<class T1, class T2, std::size_t Alignment> - inline bool operator!=(const aligned_allocator<T1, - Alignment>&, const aligned_allocator<T2, - Alignment>&) BOOST_NOEXCEPT - { - return false; - } + template<class U> + void destroy(U* ptr) { + (void)ptr; + ptr->~U(); } +}; + +template<std::size_t Alignment> +class aligned_allocator<void, Alignment> { + BOOST_STATIC_ASSERT(detail:: + is_alignment_constant<Alignment>::value); + +public: + typedef void value_type; + typedef void* pointer; + typedef const void* const_pointer; + + template<class U> + struct rebind { + typedef aligned_allocator<U, Alignment> other; + }; +}; + +template<class T1, class T2, std::size_t Alignment> +inline bool operator==(const aligned_allocator<T1, + Alignment>&, const aligned_allocator<T2, + Alignment>&) BOOST_NOEXCEPT +{ + return true; } +template<class T1, class T2, std::size_t Alignment> +inline bool operator!=(const aligned_allocator<T1, + Alignment>&, const aligned_allocator<T2, + Alignment>&) BOOST_NOEXCEPT +{ + return false; +} + +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/aligned_allocator_adaptor.hpp b/boost/align/aligned_allocator_adaptor.hpp index f6e0bef8aa..ac77b4ab9e 100644 --- a/boost/align/aligned_allocator_adaptor.hpp +++ b/boost/align/aligned_allocator_adaptor.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014-2015 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_HPP #define BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_HPP @@ -28,160 +28,163 @@ #endif namespace boost { - namespace alignment { - template<class Allocator, std::size_t Alignment> - class aligned_allocator_adaptor - : public Allocator { - BOOST_STATIC_ASSERT(detail:: - is_alignment_constant<Alignment>::value); +namespace alignment { + +template<class Allocator, std::size_t Alignment> +class aligned_allocator_adaptor + : public Allocator { + BOOST_STATIC_ASSERT(detail:: + is_alignment_constant<Alignment>::value); #if !defined(BOOST_NO_CXX11_ALLOCATOR) - typedef std::allocator_traits<Allocator> Traits; + typedef std::allocator_traits<Allocator> traits; - typedef typename Traits:: - template rebind_alloc<char> CharAlloc; + typedef typename traits:: + template rebind_alloc<char> char_alloc; - typedef typename Traits:: - template rebind_traits<char> CharTraits; + typedef typename traits:: + template rebind_traits<char> char_traits; - typedef typename CharTraits::pointer CharPtr; + typedef typename char_traits::pointer char_ptr; #else - typedef typename Allocator:: - template rebind<char>::other CharAlloc; + typedef typename Allocator:: + template rebind<char>::other char_alloc; - typedef typename CharAlloc::pointer CharPtr; + typedef typename char_alloc::pointer char_ptr; #endif - public: + enum { + ptr_align = alignment_of<char_ptr>::value + }; + +public: #if !defined(BOOST_NO_CXX11_ALLOCATOR) - typedef typename Traits::value_type value_type; - typedef typename Traits::size_type size_type; + typedef typename traits::value_type value_type; + typedef typename traits::size_type size_type; #else - typedef typename Allocator::value_type value_type; - typedef typename Allocator::size_type size_type; + typedef typename Allocator::value_type value_type; + typedef typename Allocator::size_type size_type; #endif - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef void* void_pointer; - typedef const void* const_void_pointer; - typedef std::ptrdiff_t difference_type; - - private: - typedef detail::max_align<Alignment, - detail::max_align<alignment_of<value_type>::value, - alignment_of<CharPtr>::value>::value> MaxAlign; - - public: - template<class U> - struct rebind { + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef void* void_pointer; + typedef const void* const_void_pointer; + typedef std::ptrdiff_t difference_type; + +private: + enum { + min_align = detail::max_align<Alignment, + detail::max_align<alignment_of<value_type>::value, + alignment_of<char_ptr>::value>::value>::value + }; + +public: + template<class U> + struct rebind { #if !defined(BOOST_NO_CXX11_ALLOCATOR) - typedef aligned_allocator_adaptor<typename Traits:: - template rebind_alloc<U>, Alignment> other; + typedef aligned_allocator_adaptor<typename traits:: + template rebind_alloc<U>, Alignment> other; #else - typedef aligned_allocator_adaptor<typename Allocator:: - template rebind<U>::other, Alignment> other; + typedef aligned_allocator_adaptor<typename Allocator:: + template rebind<U>::other, Alignment> other; #endif - }; + }; #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) - aligned_allocator_adaptor() = default; + aligned_allocator_adaptor() = default; #else - aligned_allocator_adaptor() - : Allocator() { - } + aligned_allocator_adaptor() + : Allocator() { + } #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - template<class A> - explicit aligned_allocator_adaptor(A&& alloc) - BOOST_NOEXCEPT - : Allocator(std::forward<A>(alloc)) { - } + template<class A> + explicit aligned_allocator_adaptor(A&& alloc) BOOST_NOEXCEPT + : Allocator(std::forward<A>(alloc)) { + } #else - template<class A> - explicit aligned_allocator_adaptor(const A& alloc) - BOOST_NOEXCEPT - : Allocator(alloc) { - } + template<class A> + explicit aligned_allocator_adaptor(const A& alloc) + BOOST_NOEXCEPT + : Allocator(alloc) { + } #endif - template<class U> - aligned_allocator_adaptor(const - aligned_allocator_adaptor<U, Alignment>& other) - BOOST_NOEXCEPT - : Allocator(other.base()) { - } - - Allocator& base() - BOOST_NOEXCEPT { - return static_cast<Allocator&>(*this); - } - - const Allocator& base() const - BOOST_NOEXCEPT { - return static_cast<const Allocator&>(*this); - } - - pointer allocate(size_type size) { - std::size_t n1 = size * sizeof(value_type); - std::size_t n2 = n1 + MaxAlign::value - 1; - CharAlloc a(base()); - CharPtr p1 = a.allocate(sizeof p1 + n2); - void* p2 = detail::addressof(*p1) + sizeof p1; - (void)align(MaxAlign::value, n1, p2, n2); - void* p3 = static_cast<CharPtr*>(p2) - 1; - ::new(p3) CharPtr(p1); - return static_cast<pointer>(p2); - } - - pointer allocate(size_type size, const_void_pointer hint) { - std::size_t n1 = size * sizeof(value_type); - std::size_t n2 = n1 + MaxAlign::value - 1; - CharPtr h = CharPtr(); - if (hint) { - h = *(static_cast<const CharPtr*>(hint) - 1); - } - CharAlloc a(base()); + template<class U> + aligned_allocator_adaptor(const aligned_allocator_adaptor<U, + Alignment>& other) BOOST_NOEXCEPT + : Allocator(other.base()) { + } + + Allocator& base() BOOST_NOEXCEPT { + return static_cast<Allocator&>(*this); + } + + const Allocator& base() const BOOST_NOEXCEPT { + return static_cast<const Allocator&>(*this); + } + + pointer allocate(size_type size) { + std::size_t n1 = size * sizeof(value_type); + std::size_t n2 = n1 + min_align - ptr_align; + char_alloc a(base()); + char_ptr p1 = a.allocate(sizeof p1 + n2); + void* p2 = detail::addressof(*p1) + sizeof p1; + (void)align(min_align, n1, p2, n2); + void* p3 = static_cast<char_ptr*>(p2) - 1; + ::new(p3) char_ptr(p1); + return static_cast<pointer>(p2); + } + + pointer allocate(size_type size, const_void_pointer hint) { + std::size_t n1 = size * sizeof(value_type); + std::size_t n2 = n1 + min_align - ptr_align; + char_ptr h = char_ptr(); + if (hint) { + h = *(static_cast<const char_ptr*>(hint) - 1); + } + char_alloc a(base()); #if !defined(BOOST_NO_CXX11_ALLOCATOR) - CharPtr p1 = CharTraits::allocate(a, sizeof p1 + - n2, h); + char_ptr p1 = char_traits::allocate(a, sizeof p1 + n2, h); #else - CharPtr p1 = a.allocate(sizeof p1 + n2, h); + char_ptr p1 = a.allocate(sizeof p1 + n2, h); #endif - void* p2 = detail::addressof(*p1) + sizeof p1; - (void)align(MaxAlign::value, n1, p2, n2); - void* p3 = static_cast<CharPtr*>(p2) - 1; - ::new(p3) CharPtr(p1); - return static_cast<pointer>(p2); - } - - void deallocate(pointer ptr, size_type size) { - CharPtr* p1 = reinterpret_cast<CharPtr*>(ptr) - 1; - CharPtr p2 = *p1; - p1->~CharPtr(); - CharAlloc a(base()); - a.deallocate(p2, size * sizeof(value_type) + - MaxAlign::value + sizeof p2); - } - }; - - 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 - { - return a.base() == b.base(); - } + void* p2 = detail::addressof(*p1) + sizeof p1; + (void)align(min_align, n1, p2, n2); + void* p3 = static_cast<char_ptr*>(p2) - 1; + ::new(p3) char_ptr(p1); + return static_cast<pointer>(p2); + } - 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 - { - return !(a == b); - } + void deallocate(pointer ptr, size_type size) { + char_ptr* p1 = reinterpret_cast<char_ptr*>(ptr) - 1; + char_ptr p2 = *p1; + p1->~char_ptr(); + char_alloc a(base()); + a.deallocate(p2, size * sizeof(value_type) + + min_align - ptr_align + sizeof p2); } +}; + +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 +{ + 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 +{ + return !(a == b); +} + +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/aligned_allocator_adaptor_forward.hpp b/boost/align/aligned_allocator_adaptor_forward.hpp index 2bd8deecfa..327d7edbf9 100644 --- a/boost/align/aligned_allocator_adaptor_forward.hpp +++ b/boost/align/aligned_allocator_adaptor_forward.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_FORWARD_HPP #define BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_FORWARD_HPP @@ -12,10 +12,12 @@ #include <cstddef> namespace boost { - namespace alignment { - template<class Allocator, std::size_t Alignment = 1> - class aligned_allocator_adaptor; - } -} +namespace alignment { + +template<class Allocator, std::size_t Alignment = 1> +class aligned_allocator_adaptor; + +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/aligned_allocator_forward.hpp b/boost/align/aligned_allocator_forward.hpp index 48120e2e7d..9a3f3635db 100644 --- a/boost/align/aligned_allocator_forward.hpp +++ b/boost/align/aligned_allocator_forward.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_FORWARD_HPP #define BOOST_ALIGN_ALIGNED_ALLOCATOR_FORWARD_HPP @@ -12,10 +12,12 @@ #include <cstddef> namespace boost { - namespace alignment { - template<class T, std::size_t Alignment = 1> - class aligned_allocator; - } -} +namespace alignment { + +template<class T, std::size_t Alignment = 1> +class aligned_allocator; + +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/aligned_delete.hpp b/boost/align/aligned_delete.hpp index 479fbb16be..6d8caed302 100644 --- a/boost/align/aligned_delete.hpp +++ b/boost/align/aligned_delete.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNED_DELETE_HPP #define BOOST_ALIGN_ALIGNED_DELETE_HPP @@ -14,19 +14,21 @@ #include <boost/align/aligned_delete_forward.hpp> namespace boost { - namespace alignment { - class aligned_delete { - public: - template<class T> - void operator()(T* ptr) const - BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(ptr->~T())) { - if (ptr) { - ptr->~T(); - alignment::aligned_free(ptr); - } - } - }; +namespace alignment { + +class aligned_delete { +public: + template<class T> + void operator()(T* ptr) const + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(ptr->~T())) { + if (ptr) { + ptr->~T(); + alignment::aligned_free(ptr); + } } -} +}; + +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/aligned_delete_forward.hpp b/boost/align/aligned_delete_forward.hpp index 9392025375..530e0970d3 100644 --- a/boost/align/aligned_delete_forward.hpp +++ b/boost/align/aligned_delete_forward.hpp @@ -1,18 +1,20 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNED_DELETE_FORWARD_HPP #define BOOST_ALIGN_ALIGNED_DELETE_FORWARD_HPP namespace boost { - namespace alignment { - class aligned_delete; - } -} +namespace alignment { + +class aligned_delete; + +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/alignment_of.hpp b/boost/align/alignment_of.hpp index 1862f0f892..06d22a0259 100644 --- a/boost/align/alignment_of.hpp +++ b/boost/align/alignment_of.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014-2015 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNMENT_OF_HPP #define BOOST_ALIGN_ALIGNMENT_OF_HPP @@ -13,18 +13,20 @@ #include <boost/align/alignment_of_forward.hpp> #include <boost/align/detail/remove_traits.hpp> -#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) -#include <boost/align/detail/alignment_of_cxx11.hpp> -#elif defined(BOOST_MSVC) +#if defined(BOOST_MSVC) #include <boost/align/detail/alignment_of_msvc.hpp> -#elif defined(BOOST_CLANG) -#include <boost/align/detail/alignment_of_clang.hpp> +#elif defined(__GNUC__) && defined(__unix__) && !defined(__LP64__) +#include <boost/align/detail/alignment_of.hpp> +#elif defined(BOOST_CLANG) && !defined(__x86_64__) +#include <boost/align/detail/alignment_of.hpp> +#elif !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) +#include <boost/align/detail/alignment_of_cxx11.hpp> #elif defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600) #include <boost/align/detail/alignment_of_gcc.hpp> #elif defined(__CODEGEARC__) #include <boost/align/detail/alignment_of_codegear.hpp> -#elif defined(__GNUC__) && defined(__unix__) && !defined(__LP64__) -#include <boost/align/detail/alignment_of.hpp> +#elif defined(BOOST_CLANG) +#include <boost/align/detail/alignment_of_clang.hpp> #elif __GNUC__ > 4 #include <boost/align/detail/alignment_of_gcc.hpp> #elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) @@ -34,16 +36,18 @@ #endif namespace boost { - namespace alignment { - template<class T> - struct alignment_of - : detail::alignment_of<typename - detail::remove_cv<typename - detail::remove_all_extents<typename - detail::remove_reference<T>:: - type>::type>::type>::type { - }; - } -} +namespace alignment { + +template<class T> +struct alignment_of + : detail::alignment_of<typename + detail::remove_cv<typename + detail::remove_all_extents<typename + detail::remove_reference<T>:: + type>::type>::type>::type { +}; + +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/alignment_of_forward.hpp b/boost/align/alignment_of_forward.hpp index 47785e24b4..778a9f73b8 100644 --- a/boost/align/alignment_of_forward.hpp +++ b/boost/align/alignment_of_forward.hpp @@ -1,19 +1,21 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_ALIGNMENT_OF_FORWARD_HPP #define BOOST_ALIGN_ALIGNMENT_OF_FORWARD_HPP namespace boost { - namespace alignment { - template<class T> - struct alignment_of; - } -} +namespace alignment { + +template<class T> +struct alignment_of; + +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/assume_aligned.hpp b/boost/align/assume_aligned.hpp new file mode 100644 index 0000000000..8d730e6d79 --- /dev/null +++ b/boost/align/assume_aligned.hpp @@ -0,0 +1,29 @@ +/* +(c) 2015 NumScale SAS +(c) 2015 LRI UMR 8623 CNRS/University Paris Sud XI + +(c) 2015 Glen Joseph Fernandes +glenjofe at gmail dot com + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_ASSUME_ALIGNED_HPP +#define BOOST_ALIGN_ASSUME_ALIGNED_HPP + +#include <boost/config.hpp> + +#if defined(BOOST_MSVC) +#include <boost/align/detail/assume_aligned_msvc.hpp> +#elif defined(BOOST_CLANG) +#include <boost/align/detail/assume_aligned_clang.hpp> +#elif BOOST_GCC_VERSION >= 40700 +#include <boost/align/detail/assume_aligned_gcc.hpp> +#elif defined(__INTEL_COMPILER) +#include <boost/align/detail/assume_aligned_intel.hpp> +#else +#include <boost/align/detail/assume_aligned.hpp> +#endif + +#endif diff --git a/boost/align/detail/address.hpp b/boost/align/detail/address.hpp index a4f3a6e84d..63be1a95d0 100644 --- a/boost/align/detail/address.hpp +++ b/boost/align/detail/address.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ADDRESS_HPP #define BOOST_ALIGN_DETAIL_ADDRESS_HPP @@ -13,15 +13,17 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { +namespace alignment { +namespace detail { + #if defined(BOOST_HAS_INTPTR_T) - typedef boost::uintptr_t address_t; +typedef boost::uintptr_t address_t; #else - typedef std::size_t address_t; +typedef std::size_t address_t; #endif - } - } -} + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/addressof.hpp b/boost/align/detail/addressof.hpp index d9d6f78ebc..8f0c88204e 100644 --- a/boost/align/detail/addressof.hpp +++ b/boost/align/detail/addressof.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ADDRESSOF_HPP #define BOOST_ALIGN_DETAIL_ADDRESSOF_HPP @@ -18,15 +18,17 @@ #endif namespace boost { - namespace alignment { - namespace detail { +namespace alignment { +namespace detail { + #if !defined(BOOST_NO_CXX11_ADDRESSOF) - using std::addressof; +using std::addressof; #else - using boost::addressof; +using boost::addressof; #endif - } - } -} + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/align.hpp b/boost/align/detail/align.hpp index e3a90dffda..00be6fd6aa 100644 --- a/boost/align/detail/align.hpp +++ b/boost/align/detail/align.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGN_HPP #define BOOST_ALIGN_DETAIL_ALIGN_HPP @@ -15,24 +15,26 @@ #include <cstddef> namespace boost { - namespace alignment { - inline void* align(std::size_t alignment, std::size_t size, - void*& ptr, std::size_t& space) - { - BOOST_ASSERT(detail::is_alignment(alignment)); - std::size_t n = detail::address_t(ptr) & (alignment - 1); - if (n != 0) { - n = alignment - n; - } - void* p = 0; - if (n <= space && size <= space - n) { - p = static_cast<char*>(ptr) + n; - ptr = p; - space -= n; - } - return p; - } +namespace alignment { + +inline void* align(std::size_t alignment, std::size_t size, + void*& ptr, std::size_t& space) +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + std::size_t n = detail::address_t(ptr) & (alignment - 1); + if (n != 0) { + n = alignment - n; + } + void* p = 0; + if (n <= space && size <= space - n) { + p = static_cast<char*>(ptr) + n; + ptr = p; + space -= n; } + return p; } +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/align_cxx11.hpp b/boost/align/detail/align_cxx11.hpp index 6672a7e0e9..80dc7e36a4 100644 --- a/boost/align/detail/align_cxx11.hpp +++ b/boost/align/detail/align_cxx11.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP #define BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP @@ -12,9 +12,11 @@ #include <memory> namespace boost { - namespace alignment { - using std::align; - } -} +namespace alignment { + +using std::align; + +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/aligned_alloc.hpp b/boost/align/detail/aligned_alloc.hpp index 147b0de0f9..1852ac15a6 100644 --- a/boost/align/detail/aligned_alloc.hpp +++ b/boost/align/detail/aligned_alloc.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014-2015 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_HPP @@ -17,34 +17,38 @@ #include <cstdlib> namespace boost { - namespace alignment { - inline void* aligned_alloc(std::size_t alignment, - std::size_t size) BOOST_NOEXCEPT - { - BOOST_ASSERT(detail::is_alignment(alignment)); - if (alignment < alignment_of<void*>::value) { - alignment = alignment_of<void*>::value; - } - std::size_t n = size + alignment - 1; - void* p1 = 0; - void* p2 = std::malloc(n + sizeof p1); - if (p2) { - p1 = static_cast<char*>(p2) + sizeof p1; - (void)align(alignment, size, p1, n); - *(static_cast<void**>(p1) - 1) = p2; - } - return p1; - } +namespace alignment { - inline void aligned_free(void* ptr) - BOOST_NOEXCEPT - { - if (ptr) { - void* p = *(static_cast<void**>(ptr) - 1); - std::free(p); - } - } +inline void* aligned_alloc(std::size_t alignment, std::size_t size) + BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + enum { + N = alignment_of<void*>::value + }; + if (alignment < N) { + alignment = N; } + std::size_t n = size + alignment - N; + void* p1 = 0; + void* p2 = std::malloc(n + sizeof p1); + if (p2) { + p1 = static_cast<char*>(p2) + sizeof p1; + (void)align(alignment, size, p1, n); + *(static_cast<void**>(p1) - 1) = p2; + } + return p1; } +inline void aligned_free(void* ptr) BOOST_NOEXCEPT +{ + if (ptr) { + void* p = *(static_cast<void**>(ptr) - 1); + std::free(p); + } +} + +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/aligned_alloc_android.hpp b/boost/align/detail/aligned_alloc_android.hpp index 2b813becae..d97d67989e 100644 --- a/boost/align/detail/aligned_alloc_android.hpp +++ b/boost/align/detail/aligned_alloc_android.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_ANDROID_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_ANDROID_HPP @@ -16,20 +16,21 @@ #include <malloc.h> namespace boost { - namespace alignment { - inline void* aligned_alloc(std::size_t alignment, - std::size_t size) BOOST_NOEXCEPT - { - BOOST_ASSERT(detail::is_alignment(alignment)); - return ::memalign(alignment, size); - } +namespace alignment { - inline void aligned_free(void* ptr) - BOOST_NOEXCEPT - { - ::free(ptr); - } - } +inline void* aligned_alloc(std::size_t alignment, std::size_t size) + BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + return ::memalign(alignment, size); } +inline void aligned_free(void* ptr) BOOST_NOEXCEPT +{ + ::free(ptr); +} + +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/aligned_alloc_macos.hpp b/boost/align/detail/aligned_alloc_macos.hpp index 346eabfc58..9b6d235133 100644 --- a/boost/align/detail/aligned_alloc_macos.hpp +++ b/boost/align/detail/aligned_alloc_macos.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MACOS_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MACOS_HPP @@ -16,30 +16,31 @@ #include <stdlib.h> namespace boost { - namespace alignment { - inline void* aligned_alloc(std::size_t alignment, - std::size_t size) BOOST_NOEXCEPT - { - BOOST_ASSERT(detail::is_alignment(alignment)); - if (!size) { - return 0; - } - if (alignment < sizeof(void*)) { - alignment = sizeof(void*); - } - void* p; - if (::posix_memalign(&p, alignment, size) != 0) { - p = 0; - } - return p; - } +namespace alignment { - inline void aligned_free(void* ptr) - BOOST_NOEXCEPT - { - ::free(ptr); - } +inline void* aligned_alloc(std::size_t alignment, std::size_t size) + BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + if (!size) { + return 0; } + if (alignment < sizeof(void*)) { + alignment = sizeof(void*); + } + void* p; + if (::posix_memalign(&p, alignment, size) != 0) { + p = 0; + } + return p; } +inline void aligned_free(void* ptr) BOOST_NOEXCEPT +{ + ::free(ptr); +} + +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/aligned_alloc_msvc.hpp b/boost/align/detail/aligned_alloc_msvc.hpp index 570a898c59..1cb7f2a3a1 100644 --- a/boost/align/detail/aligned_alloc_msvc.hpp +++ b/boost/align/detail/aligned_alloc_msvc.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MSVC_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MSVC_HPP @@ -16,20 +16,21 @@ #include <malloc.h> namespace boost { - namespace alignment { - inline void* aligned_alloc(std::size_t alignment, - std::size_t size) BOOST_NOEXCEPT - { - BOOST_ASSERT(detail::is_alignment(alignment)); - return ::_aligned_malloc(size, alignment); - } +namespace alignment { - inline void aligned_free(void* ptr) - BOOST_NOEXCEPT - { - ::_aligned_free(ptr); - } - } +inline void* aligned_alloc(std::size_t alignment, std::size_t size) + BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + return ::_aligned_malloc(size, alignment); } +inline void aligned_free(void* ptr) BOOST_NOEXCEPT +{ + ::_aligned_free(ptr); +} + +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/aligned_alloc_posix.hpp b/boost/align/detail/aligned_alloc_posix.hpp index ceab4cbe9c..3743652cbd 100644 --- a/boost/align/detail/aligned_alloc_posix.hpp +++ b/boost/align/detail/aligned_alloc_posix.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_POSIX_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_POSIX_HPP @@ -16,27 +16,28 @@ #include <stdlib.h> namespace boost { - namespace alignment { - inline void* aligned_alloc(std::size_t alignment, - std::size_t size) BOOST_NOEXCEPT - { - BOOST_ASSERT(detail::is_alignment(alignment)); - if (alignment < sizeof(void*)) { - alignment = sizeof(void*); - } - void* p; - if (::posix_memalign(&p, alignment, size) != 0) { - p = 0; - } - return p; - } +namespace alignment { - inline void aligned_free(void* ptr) - BOOST_NOEXCEPT - { - ::free(ptr); - } +inline void* aligned_alloc(std::size_t alignment, std::size_t size) + BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + if (alignment < sizeof(void*)) { + alignment = sizeof(void*); } + void* p; + if (::posix_memalign(&p, alignment, size) != 0) { + p = 0; + } + return p; +} + +inline void aligned_free(void* ptr) BOOST_NOEXCEPT +{ + ::free(ptr); } +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/aligned_alloc_sunos.hpp b/boost/align/detail/aligned_alloc_sunos.hpp index a2373bd26b..c5778cdd75 100644 --- a/boost/align/detail/aligned_alloc_sunos.hpp +++ b/boost/align/detail/aligned_alloc_sunos.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_SUNOS_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_SUNOS_HPP @@ -16,20 +16,21 @@ #include <stdlib.h> namespace boost { - namespace alignment { - inline void* aligned_alloc(std::size_t alignment, - std::size_t size) BOOST_NOEXCEPT - { - BOOST_ASSERT(detail::is_alignment(alignment)); - return ::memalign(alignment, size); - } +namespace alignment { - inline void aligned_free(void* ptr) - BOOST_NOEXCEPT - { - ::free(ptr); - } - } +inline void* aligned_alloc(std::size_t alignment, std::size_t size) + BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + return ::memalign(alignment, size); } +inline void aligned_free(void* ptr) BOOST_NOEXCEPT +{ + ::free(ptr); +} + +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/alignment_of.hpp b/boost/align/detail/alignment_of.hpp index 1fa3070ce0..b1d2d56920 100644 --- a/boost/align/detail/alignment_of.hpp +++ b/boost/align/detail/alignment_of.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_HPP @@ -13,15 +13,17 @@ #include <boost/align/detail/offset_object.hpp> namespace boost { - namespace alignment { - namespace detail { - template<class T> - struct alignment_of - : min_size<sizeof(T), - sizeof(offset_object<T>) - sizeof(T)>::type { - }; - } - } -} +namespace alignment { +namespace detail { + +template<class T> +struct alignment_of + : min_size<sizeof(T), + sizeof(offset_object<T>) - sizeof(T)>::type { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/alignment_of_clang.hpp b/boost/align/detail/alignment_of_clang.hpp index 18d7c718db..fa96a37d9d 100644 --- a/boost/align/detail/alignment_of_clang.hpp +++ b/boost/align/detail/alignment_of_clang.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CLANG_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CLANG_HPP @@ -13,14 +13,16 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { - template<class T> - struct alignment_of - : integral_constant<std::size_t, __alignof(T)> { - }; - } - } -} +namespace alignment { +namespace detail { + +template<class T> +struct alignment_of + : integral_constant<std::size_t, __alignof(T)> { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/alignment_of_codegear.hpp b/boost/align/detail/alignment_of_codegear.hpp index 9074967f49..e8986cef66 100644 --- a/boost/align/detail/alignment_of_codegear.hpp +++ b/boost/align/detail/alignment_of_codegear.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CODEGEAR_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CODEGEAR_HPP @@ -13,14 +13,16 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { - template<class T> - struct alignment_of - : integral_constant<std::size_t, alignof(T)> { - }; - } - } -} +namespace alignment { +namespace detail { + +template<class T> +struct alignment_of + : integral_constant<std::size_t, alignof(T)> { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/alignment_of_cxx11.hpp b/boost/align/detail/alignment_of_cxx11.hpp index d5d00a08b4..0f66098b67 100644 --- a/boost/align/detail/alignment_of_cxx11.hpp +++ b/boost/align/detail/alignment_of_cxx11.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CXX11_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CXX11_HPP @@ -12,11 +12,13 @@ #include <type_traits> namespace boost { - namespace alignment { - namespace detail { - using std::alignment_of; - } - } -} +namespace alignment { +namespace detail { + +using std::alignment_of; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/alignment_of_gcc.hpp b/boost/align/detail/alignment_of_gcc.hpp index 3044b2a3ec..615968b477 100644 --- a/boost/align/detail/alignment_of_gcc.hpp +++ b/boost/align/detail/alignment_of_gcc.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_GCC_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_GCC_HPP @@ -13,14 +13,16 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { - template<class T> - struct alignment_of - : integral_constant<std::size_t, __alignof__(T)> { - }; - } - } -} +namespace alignment { +namespace detail { + +template<class T> +struct alignment_of + : integral_constant<std::size_t, __alignof__(T)> { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/alignment_of_msvc.hpp b/boost/align/detail/alignment_of_msvc.hpp index a86f785ddc..87d6ac8e28 100644 --- a/boost/align/detail/alignment_of_msvc.hpp +++ b/boost/align/detail/alignment_of_msvc.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP @@ -13,15 +13,16 @@ #include <boost/align/detail/offset_object.hpp> namespace boost { - namespace alignment { - namespace detail { - template<class T> - struct alignment_of - : min_size<sizeof(T), - offsetof(offset_object<T>, object)>::type { - }; - } - } -} +namespace alignment { +namespace detail { + +template<class T> +struct alignment_of + : min_size<sizeof(T), offsetof(offset_object<T>, object)>::type { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/assume_aligned.hpp b/boost/align/detail/assume_aligned.hpp new file mode 100644 index 0000000000..0ecefa1dd0 --- /dev/null +++ b/boost/align/detail/assume_aligned.hpp @@ -0,0 +1,17 @@ +/* +(c) 2015 NumScale SAS +(c) 2015 LRI UMR 8623 CNRS/University Paris Sud XI + +(c) 2015 Glen Joseph Fernandes +glenjofe at gmail dot com + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_HPP +#define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_HPP + +#define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) + +#endif diff --git a/boost/align/detail/assume_aligned_clang.hpp b/boost/align/detail/assume_aligned_clang.hpp new file mode 100644 index 0000000000..d72b4cae86 --- /dev/null +++ b/boost/align/detail/assume_aligned_clang.hpp @@ -0,0 +1,21 @@ +/* +(c) 2015 Glen Joseph Fernandes +glenjofe at gmail dot com + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_CLANG_HPP +#define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_CLANG_HPP + +#include <stdint.h> + +#if defined(__has_builtin) && __has_builtin(__builtin_assume) +#define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) \ +__builtin_assume((uintptr_t(ptr) & ((alignment) - 1)) == 0) +#else +#define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) +#endif + +#endif diff --git a/boost/align/detail/assume_aligned_gcc.hpp b/boost/align/detail/assume_aligned_gcc.hpp new file mode 100644 index 0000000000..a1e6cb0280 --- /dev/null +++ b/boost/align/detail/assume_aligned_gcc.hpp @@ -0,0 +1,18 @@ +/* +(c) 2015 NumScale SAS +(c) 2015 LRI UMR 8623 CNRS/University Paris Sud XI + +(c) 2015 Glen Joseph Fernandes +glenjofe at gmail dot com + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_GCC_HPP +#define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_GCC_HPP + +#define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) \ +(ptr) = __builtin_assume_aligned((ptr), (alignment)) + +#endif diff --git a/boost/align/detail/assume_aligned_intel.hpp b/boost/align/detail/assume_aligned_intel.hpp new file mode 100644 index 0000000000..aaaf331802 --- /dev/null +++ b/boost/align/detail/assume_aligned_intel.hpp @@ -0,0 +1,18 @@ +/* +(c) 2015 NumScale SAS +(c) 2015 LRI UMR 8623 CNRS/University Paris Sud XI + +(c) 2015 Glen Joseph Fernandes +glenjofe at gmail dot com + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_INTEL_HPP +#define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_INTEL_HPP + +#define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) \ +__assume_aligned((ptr), (alignment)) + +#endif diff --git a/boost/align/detail/assume_aligned_msvc.hpp b/boost/align/detail/assume_aligned_msvc.hpp new file mode 100644 index 0000000000..fdad429b08 --- /dev/null +++ b/boost/align/detail/assume_aligned_msvc.hpp @@ -0,0 +1,20 @@ +/* +(c) 2015 NumScale SAS +(c) 2015 LRI UMR 8623 CNRS/University Paris Sud XI + +(c) 2015 Glen Joseph Fernandes +glenjofe at gmail dot com + +Distributed under the Boost Software +License, Version 1.0. +http://boost.org/LICENSE_1_0.txt +*/ +#ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_MSVC_HPP +#define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_MSVC_HPP + +#include <stddef.h> + +#define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) \ +__assume((uintptr_t(ptr) & ((alignment) - 1)) == 0) + +#endif diff --git a/boost/align/detail/integral_constant.hpp b/boost/align/detail/integral_constant.hpp index 332aade943..6116fea5f5 100644 --- a/boost/align/detail/integral_constant.hpp +++ b/boost/align/detail/integral_constant.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP #define BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP @@ -16,31 +16,33 @@ #endif namespace boost { - namespace alignment { - namespace detail { +namespace alignment { +namespace detail { + #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) - using std::integral_constant; +using std::integral_constant; #else - template<class T, T Value> - struct integral_constant { - typedef T value_type; - typedef integral_constant<T, Value> type; +template<class T, T Value> +struct integral_constant { + typedef T value_type; + typedef integral_constant<T, Value> type; #if !defined(BOOST_NO_CXX11_CONSTEXPR) - constexpr operator value_type() const { - return Value; - } + constexpr operator value_type() const { + return Value; + } - static constexpr T value = Value; + static constexpr T value = Value; #else - enum { - value = Value - }; + enum { + value = Value + }; #endif - }; +}; #endif - } - } -} + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/is_aligned.hpp b/boost/align/detail/is_aligned.hpp index 41fb80581f..a861e9f4c8 100644 --- a/boost/align/detail/is_aligned.hpp +++ b/boost/align/detail/is_aligned.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_IS_ALIGNED_HPP #define BOOST_ALIGN_DETAIL_IS_ALIGNED_HPP @@ -16,14 +16,16 @@ #include <cstddef> namespace boost { - namespace alignment { - inline bool is_aligned(std::size_t alignment, - const void* ptr) BOOST_NOEXCEPT - { - BOOST_ASSERT(detail::is_alignment(alignment)); - return (detail::address_t(ptr) & (alignment - 1)) == 0; - } - } +namespace alignment { + +inline bool is_aligned(std::size_t alignment, const void* ptr) + BOOST_NOEXCEPT +{ + BOOST_ASSERT(detail::is_alignment(alignment)); + return (detail::address_t(ptr) & (alignment - 1)) == 0; } +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/is_alignment.hpp b/boost/align/detail/is_alignment.hpp index 532198363f..7ac0bb3d12 100644 --- a/boost/align/detail/is_alignment.hpp +++ b/boost/align/detail/is_alignment.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP #define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP @@ -13,15 +13,17 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { - BOOST_CONSTEXPR inline bool is_alignment(std::size_t - value) BOOST_NOEXCEPT - { - return (value > 0) && ((value & (value - 1)) == 0); - } - } - } +namespace alignment { +namespace detail { + +BOOST_CONSTEXPR inline bool is_alignment(std::size_t value) + BOOST_NOEXCEPT +{ + return (value > 0) && ((value & (value - 1)) == 0); } +} /* :detail */ +} /* :alignment */ +} /* :boost */ + #endif diff --git a/boost/align/detail/is_alignment_constant.hpp b/boost/align/detail/is_alignment_constant.hpp index 8f422608ae..4c703cafc0 100644 --- a/boost/align/detail/is_alignment_constant.hpp +++ b/boost/align/detail/is_alignment_constant.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_IS_ALIGNMENT_CONSTANT_HPP #define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_CONSTANT_HPP @@ -13,15 +13,16 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { - template<std::size_t N> - struct is_alignment_constant - : integral_constant<bool, - (N > 0) && ((N & (N - 1)) == 0)> { - }; - } - } -} +namespace alignment { +namespace detail { + +template<std::size_t N> +struct is_alignment_constant + : integral_constant<bool, (N > 0) && ((N & (N - 1)) == 0)> { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/max_align.hpp b/boost/align/detail/max_align.hpp index 775121d83a..4351a5a2ed 100644 --- a/boost/align/detail/max_align.hpp +++ b/boost/align/detail/max_align.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_MAX_ALIGN_HPP #define BOOST_ALIGN_DETAIL_MAX_ALIGN_HPP @@ -13,15 +13,16 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { - template<std::size_t A, std::size_t B> - struct max_align - : integral_constant<std::size_t, - (A > B) ? A : B> { - }; - } - } -} +namespace alignment { +namespace detail { + +template<std::size_t A, std::size_t B> +struct max_align + : integral_constant<std::size_t, (A > B) ? A : B> { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/max_count_of.hpp b/boost/align/detail/max_count_of.hpp index 3ba4eae70e..e0ae3bce96 100644 --- a/boost/align/detail/max_count_of.hpp +++ b/boost/align/detail/max_count_of.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_MAX_COUNT_OF_HPP #define BOOST_ALIGN_DETAIL_MAX_COUNT_OF_HPP @@ -13,15 +13,17 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { - template<class T> - struct max_count_of - : integral_constant<std::size_t, - ~static_cast<std::size_t>(0) / sizeof(T)> { - }; - } - } -} +namespace alignment { +namespace detail { + +template<class T> +struct max_count_of + : integral_constant<std::size_t, + ~static_cast<std::size_t>(0) / sizeof(T)> { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/min_size.hpp b/boost/align/detail/min_size.hpp index 80d3a7a6ed..71afe8c686 100644 --- a/boost/align/detail/min_size.hpp +++ b/boost/align/detail/min_size.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_MIN_SIZE_HPP #define BOOST_ALIGN_DETAIL_MIN_SIZE_HPP @@ -13,15 +13,16 @@ #include <cstddef> namespace boost { - namespace alignment { - namespace detail { - template<std::size_t A, std::size_t B> - struct min_size - : integral_constant<std::size_t, - (A < B) ? A : B> { - }; - } - } -} +namespace alignment { +namespace detail { + +template<std::size_t A, std::size_t B> +struct min_size + : integral_constant<std::size_t, (A < B) ? A : B> { +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/offset_object.hpp b/boost/align/detail/offset_object.hpp index 8168595230..2055edfb4a 100644 --- a/boost/align/detail/offset_object.hpp +++ b/boost/align/detail/offset_object.hpp @@ -1,24 +1,26 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_OFFSET_OBJECT_HPP #define BOOST_ALIGN_DETAIL_OFFSET_OBJECT_HPP namespace boost { - namespace alignment { - namespace detail { - template<class T> - struct offset_object { - char offset; - T object; - }; - } - } -} +namespace alignment { +namespace detail { + +template<class T> +struct offset_object { + char offset; + T object; +}; + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/detail/remove_traits.hpp b/boost/align/detail/remove_traits.hpp index d44860ed6b..f59d6bf9e8 100644 --- a/boost/align/detail/remove_traits.hpp +++ b/boost/align/detail/remove_traits.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_DETAIL_REMOVE_TRAITS_HPP #define BOOST_ALIGN_DETAIL_REMOVE_TRAITS_HPP @@ -18,73 +18,75 @@ #endif namespace boost { - namespace alignment { - namespace detail { +namespace alignment { +namespace detail { + #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) - using std::remove_reference; - using std::remove_all_extents; - using std::remove_cv; +using std::remove_reference; +using std::remove_all_extents; +using std::remove_cv; #else - template<class T> - struct remove_reference { - typedef T type; - }; +template<class T> +struct remove_reference { + typedef T type; +}; - template<class T> - struct remove_reference<T&> { - typedef T type; - }; +template<class T> +struct remove_reference<T&> { + typedef T type; +}; #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - template<class T> - struct remove_reference<T&&> { - typedef T type; - }; +template<class T> +struct remove_reference<T&&> { + typedef T type; +}; #endif - template<class T> - struct remove_all_extents { - typedef T type; - }; - - template<class T> - struct remove_all_extents<T[]> { - typedef typename remove_all_extents<T>::type type; - }; - - template<class T, std::size_t N> - struct remove_all_extents<T[N]> { - typedef typename remove_all_extents<T>::type type; - }; - - template<class T> - struct remove_const { - typedef T type; - }; - - template<class T> - struct remove_const<const T> { - typedef T type; - }; - - template<class T> - struct remove_volatile { - typedef T type; - }; - - template<class T> - struct remove_volatile<volatile T> { - typedef T type; - }; - - template<class T> - struct remove_cv { - typedef typename remove_volatile<typename - remove_const<T>::type>::type type; - }; +template<class T> +struct remove_all_extents { + typedef T type; +}; + +template<class T> +struct remove_all_extents<T[]> { + typedef typename remove_all_extents<T>::type type; +}; + +template<class T, std::size_t N> +struct remove_all_extents<T[N]> { + typedef typename remove_all_extents<T>::type type; +}; + +template<class T> +struct remove_const { + typedef T type; +}; + +template<class T> +struct remove_const<const T> { + typedef T type; +}; + +template<class T> +struct remove_volatile { + typedef T type; +}; + +template<class T> +struct remove_volatile<volatile T> { + typedef T type; +}; + +template<class T> +struct remove_cv { + typedef typename remove_volatile<typename + remove_const<T>::type>::type type; +}; #endif - } - } -} + +} /* :detail */ +} /* :alignment */ +} /* :boost */ #endif diff --git a/boost/align/is_aligned.hpp b/boost/align/is_aligned.hpp index de286655af..7473864ca7 100644 --- a/boost/align/is_aligned.hpp +++ b/boost/align/is_aligned.hpp @@ -1,10 +1,10 @@ /* - (c) 2014 Glen Joseph Fernandes - glenjofe at gmail dot com +(c) 2014 Glen Joseph Fernandes +glenjofe at gmail dot 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://boost.org/LICENSE_1_0.txt */ #ifndef BOOST_ALIGN_IS_ALIGNED_HPP #define BOOST_ALIGN_IS_ALIGNED_HPP |