Boost logo

Boost Users :

From: Black Ice (yg-boost-users_at_[hidden])
Date: 2003-01-05 20:41:53


Should I rebuild .lib file after altering?

--
/*******************/
自由(liberty)无非就是这样一种承诺:每个人将会得到一种保障,保障我们可以与
权威、多数、流俗及舆论的影响相抗衡。
/*******************/
"Jeff Garland" <jeff_at_[hidden]> 写入消息新闻
:jUsT.aNoTheR.mEsSaGe.iD.10416929881593_at_crystalclearsoftware.com...
>
>
>
> > After I move the line 'using std namespace', the error still occurs.
> > The error occurs in file date_time/time_duration.hpp, line 66.
> >     min_type minutes() const
> >     {
> >       return std::abs(((ticks() / (60*rep_type::res_adjust())) % 60));
> >     }
> >
>
> It seems like the abs function declared in
boost/date_time/compiler_config.
> hpp
> will not be included due to the macro configuration. The relavant
> code snippet
> is:
>
> //boost/date_time/compiler_config.hpp
> //Work around compilers that don't have std::abs
> #if (__GNUC__ <= 3)|| (defined(BOOST_MSVC) && _MSC_VER <= 1200)
> #  define BOOST_NO_LONG_LONG_ABS
> #endif
>
> #if defined(BOOST_NO_LONG_LONG_ABS)
> namespace std
> {
>     template <typename T> // JDG [7/6/02 made a template]
>     inline T abs(T x)
>     {
>       return x < 0 ? -x : x;
>     }
> }
> #endif
>
> You might try altering this so that the function will be defined.
> Something like (line 22)
>
> #if (__GNUC__ <= 3)|| defined(BOOST_MSVC)
>
> should do the trick.  The only thing is that past testing with
> newer versions of MSVC did not require this so I'm a bit suprised
> that this is needed.  This will only work if the problem is that
> the compiler is trying to convert the underlying type boost::int64_t
> into a long or another type because it lacks a std::abs for
> this type.
>
> Jeff
>
>
>
>
>
>
>
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net