
On 09/10/2011 07:39 AM, Beman Dawes wrote:
Consider this alternative:
A class template, perhaps named "endian_buffer", that is the same as the current class endian except it does not provide the operators. The typedefs provided would have "buf" added to the name (E.G. big32buf_t, etc.)
A class template, perhaps named "endian_integer", that publicly inherits from "endian_buffer" and also provides the operators. In functionality it would thus be identical to the current class "endian", including the current typedefs.
...
It seems to me this addresses the concerns of those who want explicit separate of the boundary between I/O and processing, and that it will make users more aware of choices in program organization. Do others agree? +1. Assuming you support float/double how do you invision them fitting into the picture? Do they only get endian_buffer support? What about changing endian_integer to the more generic endian_value and providing just those operators common to all builtin types? That would mean removing the bitwise operators. If desired, endian_integer could inherit from endian_value and add in those extra operators.