Boost logo

Boost Users :

From: Peng Yu (pengyu.ut_at_[hidden])
Date: 2007-10-16 12:27:07


On 10/15/07, John Maddock <john_at_[hidden]> wrote:
> Chad Walters wrote:
> > It's not entirely clear from your description if you really need to
> > have is_arithmetic be true for your fixed_point class or if you just
> > want to have some predicate that is true for both the built-in
> > arithmetic types and your fixed_point class.
> >
> > If the former, then you will likely run afoul of problems, for the
> > reasons previously pointed out.
> >
> > Hopefully it is the latter - in which case you should just define
> > your own predicate with the appropriate logic (true for fixed_point
> > or is_arithmetic types).
>
> Right, or mpl::bool_<std::numeric_limits<T>::is_specialized> if you go down
> the "specialise numeric_limits" route.

Let me rephrase what you meaning to make sure that I understand you.
You mean mpl::bool_<std::numeric_limits<T>::is_specialized> is the
same as boost::is_arithmetic<T>::type for all basic none pointer type
(int, double, unsigned...).

It would cause less problems to specializing std::numeric_limits
rather that specializing the user defined type like fixed point,
right?

Therefore, in this case,
mpl::bool_<std::numeric_limits<T>::is_specialized> shall be used to
test whether T is an number type, right?

Thanks,
Peng


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