Boost logo

Boost :

Subject: Re: [boost] [ICL] #6853: boost::icl::contains(NaN) returns true
From: Andrew Hundt (athundt_at_[hidden])
Date: 2012-05-08 14:44:11


>
> template<class Float>
> struct NaNtheLess
> {
> bool operator()(Float lhs, Float rhs)const
> {
> return tr1::isnan(lhs)
> ? !tr1::isnan(rhs)
> : std::less<Float>()(lhs, rhs);
> }
> };

...

> Hope this solves your problems.

 That looks like a great solution, thanks! Perhaps this is useful for
simplifying "not_a_date_time" too.

NaNtheless, I am a NaN loather ;)
>
> Cheers,
> Joachim
>

I find it NaNcomfortable to deal with as well, and I can feel your pain. :-)

Cheers!
Andrew Hundt


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