id summary reporter owner description type status milestone component version severity resolution keywords cc 3731 array without padding anonymous No-Maintainer "Sometimes you have a struct with array in it: {{{ #!cpp #pragma pack(push, 1) struct X { int i[10]; }; #pragma pack(pop) }}} And you want to use boost::array : {{{ #!cpp #pragma pack(push, 1) struct X { boost::array i; }; #pragma pack(pop) }}} The problem that boost::array is not surrounded with #pragma pack. It would be nice to add a new class boost::array_no_padding with #pragma pack surrounded and with static assert for size checking. {{{ #!cpp #if !BOOST_SUPPORTS_PRAGMA_PACK && !BOOST_SUPPORTS_ALIGNMENT_PREFIX && !BOOST_SUPPORTS_ALIGNMENT_SUFFIX #error Cannot specify alighnemnt #endif namespace boost { #if BOOST_SUPPORTS_PRAGMA_PACK #define ALIGNMENT_SET #pramga pack(push, 1) #endif template class #if !defined(ALIGNMENT) && BOOST_SUPPORTS_ALIGNMENT_PREFIX // Could be __declspec(align(1)) BOOST_ALIGNMENT_PREFIX #define ALIGNMENT_SET #endif array_no_padding #if !defined(ALIGNMENT) && BOOST_SUPPORTS_ALIGNMENT_SUFFIX // Could be __attribute__((aligned(1))) BOOST_ALIGNMENT_SUFFIX #define ALIGNMENT_SET #endif // Can derive from boost::array or copy-paste all the content : boost::array { // ... // Check class size with the array size BOOST_STATIC_ASSERT( sizeof(*this) == sizeof(T[N]) ); } #if BOOST_SUPPORTS_PRAGMA_PACK #pragma pack(pop) #endif }}} Thanx !" Feature Requests closed Boost 1.42.0 array Boost 1.41.0 Problem wontfix