Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Request for comments/interest
From: Kim Barrett (kab.conundrums_at_[hidden])
Date: 2010-05-27 10:32:18


On May 27, 2010, at 9:10 AM, Stewart, Robert wrote:
> Here's another take on the interface:
>
> template <class T, class U>
> void
> from_big_endian(T &, U);
>
> [... snip several more ...]
> template <class T, class U>
> T
> little_endian_cast(U);
>
> Obviously, I've embedded the direction and ordering in the function template names rather than in a template argument, but that looks more readable to me.

What about various flavors of mixed / middle endian? Some of them actually do appear in the wild, which leads me to prefer the template argument approach to a potential proliferation of function names. The template argument approach also might be easier to work with in generic code.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk