Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Chapter 2. Boost.Align

Glen Fernandes

Distributed under the Boost Software License, Version 1.0.

Table of Contents

Introduction
Rationale
Tutorial
Using align
Using aligned_alloc
Using aligned_allocator
Using aligned_allocator_adaptor
Using aligned_delete
Using alignment_of
Using is_aligned
Examples
aligned_ptr and make_aligned
aligned_vector
Reference
Header <boost/align.hpp>
Header <boost/align/align.hpp>
Header <boost/align/aligned_alloc.hpp>
Header <boost/align/aligned_allocator.hpp>
Header <boost/align/aligned_allocator_adaptor.hpp>
Header <boost/align/aligned_allocator_adaptor_forward.hpp>
Header <boost/align/aligned_allocator_forward.hpp>
Header <boost/align/aligned_delete.hpp>
Header <boost/align/aligned_delete_forward.hpp>
Header <boost/align/alignment_of.hpp>
Header <boost/align/alignment_of_forward.hpp>
Header <boost/align/is_aligned.hpp>
Vocabulary
3.11 [basic.align]
Compatibility
Acknowledgments
History
Version 1.0

This library provides function align for implementations which do not have the C++11 standard library std::align function available.

It provides allocation and deallocation functions, aligned_alloc and aligned_free, as their functionality is not yet available in the C++ standard library. They use platform specific functions, if available, or use standard library functions in conjunction with align.

It provides C++ allocators, class templates aligned_allocator and aligned_allocator_adaptor, which respect alignment. The first uses aligned_alloc and aligned_free while the second uses the allocator in conjunction with align.

It provides a deleter, class aligned_delete, which makes use of aligned_free. It is suitable for use with constructed objects allocated with aligned_alloc.

It provides type trait alignment_of for implementations without a conforming C++11 standard library std::alignment_of type trait.

It also provides function is_aligned to test the alignment of a pointer.

Last revised: July 29, 2014 at 09:04:14 GMT


PrevUpHomeNext