Class little_endian_policy

Synopsis

#include "breeze/endianness/endian_codec.hpp"

class little_endian_policy

Description

Little-endian policy for endian_codec.

Methods

index
shift_amount

Source

Lines 135-153 in breeze/endianness/endian_codec.hpp.

class little_endian_policy
{
public:
    // n == required_count - 1 to produce the first Byte
    //
    template< typename T, typename Byte, std::ptrdiff_t n >
    static int          shift_amount()
    {
        return ( endian_codec_private::required_count< T, Byte >::value - 1 - n ) *
            meta::width< Byte >::value ;
    }

    template< typename T, typename Byte >
    static std::ptrdiff_t
                        index( std::ptrdiff_t n )
    {
        return endian_codec_private::required_count< T, Byte >::value - 1 - n ;
    }
} ;