Ticket #5491: functional.patch

File functional.patch, 1.7 KB (added by Akira Takahashi <faithandbrave@…>, 12 years ago)

add check numeric_limits::is_specialized

  • boost/accumulators/numeric/functional.hpp

     
    1010
    1111#include <limits>
    1212#include <functional>
     13#include <boost/static_assert.hpp>
    1314#include <boost/mpl/if.hpp>
    1415#include <boost/mpl/and.hpp>
    1516#include <boost/type_traits/remove_const.hpp>
     
    277278        struct as_min_base
    278279          : std::unary_function<Arg, typename remove_const<Arg>::type>
    279280        {
     281            BOOST_STATIC_ASSERT(std::numeric_limits<typename remove_const<Arg>::type>::is_specialized);
     282
    280283            typename remove_const<Arg>::type operator ()(Arg &) const
    281284            {
    282285                return (std::numeric_limits<typename remove_const<Arg>::type>::min)();
     
    287290        struct as_min_base<Arg, typename enable_if<is_floating_point<Arg> >::type>
    288291          : std::unary_function<Arg, typename remove_const<Arg>::type>
    289292        {
     293            BOOST_STATIC_ASSERT(std::numeric_limits<typename remove_const<Arg>::type>::is_specialized);
     294
    290295            typename remove_const<Arg>::type operator ()(Arg &) const
    291296            {
    292297                return -(std::numeric_limits<typename remove_const<Arg>::type>::max)();
     
    297302        struct as_max_base
    298303          : std::unary_function<Arg, typename remove_const<Arg>::type>
    299304        {
     305            BOOST_STATIC_ASSERT(std::numeric_limits<typename remove_const<Arg>::type>::is_specialized);
     306
    300307            typename remove_const<Arg>::type operator ()(Arg &) const
    301308            {
    302309                return (std::numeric_limits<typename remove_const<Arg>::type>::max)();