| Home | Libraries | People | FAQ | More

## Function template float_mem_cast

boost::sort::spreadsort::float_mem_cast — Casts a float to the specified integer type.

## Synopsis

    // In header: <boost/sort/spreadsort/float_sort.hpp>

    template<typename Data_type, typename Cast_type>
      Cast_type float_mem_cast(const Data_type & data);

## Description

Example:

    struct rightshift {
      int operator()(const DATA_TYPE &x, const unsigned offset) const {
        return float_mem_cast<KEY_TYPE, CAST_TYPE>(x.key) >> offset;
      }
    };

Template Parameters:

`Cast_type` | Integer type (same size) to which to cast.
`Data_type` | Floating-point IEEE 754/IEC559 type.