Boost logo

Boost Users :

Subject: Re: [Boost-users] [function] generalization of std::plus and std::multiplies with more than one argument type
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-10-16 10:52:54


AMDG

alfC wrote:
> The reason I returned to my post is that today I found boost/mpl/
> plus.hpp and boost/mpl/multiplies.hpp which seem to answer the first
> part of my question (although not the syntactic sugar part).
>

mpl::plus and mpl::multiplies are not function objects. You
can't use them with int, for example. They are metafunctions
that mainly work with MPL Integral Constant Wrappers:

BOOST_MPL_ASSERT((boost::mpl::equal_to<
  boost::mpl::plus<boost::mpl::int_<1>, boost::mpl::int_<2> >,
  boost::mpl::int_<3> >));

In Christ,
Steven Watanabe


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