Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Summary of discussion #1
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-06-04 07:57:05

----- Original Message -----
From: "Stewart, Robert" <Robert.Stewart_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, June 04, 2010 12:54 PM
Subject: Re: [boost] [boost::endian] Summary of discussion #1

> vicente.botet wrote:
>> The single difference between endian_pack and the original
>> endian is that it don't inherits from cover_operators.
> That should be the primary interface because it doesn't encourage using inefficient arithmetic operators, so that should be named boost::endian.

First, currently is boost::integer::endian_pack and not boost::endian_pack, as it works only with integers.

Well, I have no other problem than preserving the current interface. We can discuss of course of better names.
>> The original endian class could be declared as
>> template <BOOST_SCOPED_ENUM(endianness) E, typename T,
>> std::size_t n_bits,
>> BOOST_SCOPED_ENUM(alignment) A = alignment::unaligned>
>> class endian : cover_operators< endian< E, T, n_bits, A >, T >
>> {
> The class with operators should be named in such a way to indicate that it manages endianness and provides the arithmetic operators, so I suggest boost::endian_integer.

As I said above I was just preserving the current interface. As for now endian is in the namespace interger, it is clear for me that we are working with endian integers.

If we can put names in the boost namespace then the names need to be reconsidered. As the classes works only with integers I see the following possibilities


But no boost::endian.
Have you other proposition that respect the fact that these classes works only with integers?
> Given those names, why wouldn't endian_integer inherit from endian?
I was sure someone will ask this. We can inherit, but this introduce multiple inheritance, which I wanted to avoid. Could you describes the advantages to inherit?

Boost list run by bdawes at, gregod at, cpdaniel at, john at