
25 Jun
2009
25 Jun
'09
7:46 p.m.
Hi, An important feature of the fixed point template is that it takes up no more space than the underlying integer. It should be possible to use reinterpret_cast to convert a third party integer pointer (representing fixed ints) to a fixed point template pointer. The way I ensure that in my fixed point template is with a #pragma: #pragma pack(push, 1) ... template struct ... #pragma pack(pop) This is supported by MSVC++ as well as gcc. However it is only defacto standard, so it might not work on any other compiler. Is there a more standard way to make sure that the struct is not padded to some memory alignment size? Soren