Subject: Re: [boost] Review Request: Algorithm.Sorting
From: Ross Levine (ross.levine_at_[hidden])
Date: 2009-05-08 13:33:06
Maybe instead of a static assert, do some sort of conditional compilation or
template metaprogramming, such that if
std::numeric_limits<Data_type>::is_iec559 is false, it just defaults to
std::sort? That would be more cross-platform.
Also, couldn't you just use reinterpret_cast instead of memcpy? Or is there
a problem with that?
I must say that this sort of thing could be very useful.
On Wed, May 6, 2009 at 10:43 PM, Steven Ross <spreadsort_at_[hidden]> wrote:
> Does this ease your mind? float_sort shouldn't compile if the float type
> isn't correct, and this is the code I've been using for casting floats to
> BOOST_STATIC_ASSERT(sizeof(Cast_type) == sizeof(Data_type));
> Cast_type result;
> std::memcpy(&result, &(*floatiter), sizeof(Data_type));
> Also, the mostly-sorted performance issue is resolved; performance is now
> comparable on Windows between integer_sort and std::sort on mostly-sorted
> data, without any platform-specific edits.
> That should resolve all outstanding concerns I am aware of.
> On Wed, May 6, 2009 at 1:26 PM, Ross Levine <ross.levine_at_[hidden]> wrote:
> > On Mon, Apr 27, 2009 at 10:32 AM, Steven Ross <spreadsort_at_[hidden]>
> > wrote:
> > > float_sort, which sorts IEEE floating-point numbers as integers
> > This worries me a little. C++ floating-point format is
> > implementation-defined, and is not necessarily in IEEE 754.
> > _______________________________________________
> > Unsubscribe & other changes:
> > http://lists.boost.org/mailman/listinfo.cgi/boost
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk