Subject: [Boost-bugs] [Boost C++ Libraries] #1946: [type_traits] type_with_alignment fails on non-power-of-2 alignment
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-05-24 15:22:59
#1946: [type_traits] type_with_alignment fails on non-power-of-2 alignment
-----------------------------------+----------------------------------------
Reporter: andysem_at_[hidden] | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: type_traits
Version: Boost 1.35.0 | Severity: Problem
Keywords: type_traits alignment |
-----------------------------------+----------------------------------------
The type_with_alignment template fails to compile if the alignment is not
a power of 2. This is a possible situation at least with MSVC 9.0. The
following class of a user-defined stream gets alignment of 12:
class my_stream :
public std::ostream
{
public:
typedef boost::function0< void > function_type;
function_type m_function;
};
I've attached a reduced code sample with more comments and the compiler
error message.
I suggest to add a fallback type_with_alignment type in case if the
alignment is not a power of 2. This type should have the requested
alignment. It may be achieved with the __declspec(align(n)) specifier.
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1946>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC