Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-31 09:23:42


"Andy Little" <andy_at_[hidden]> writes:

> Hi,
> Following preliminary ok of "pow" mpl metafunction by Alexey
> Gurtovoy... Here are some basic headers for mpl functions pow_, root_ and
> reciprocal.
>
> useage:
> boost::mpl::pow_<type,exponent>::type
> boost::mpl::root_<type,exponent>::type
> boost::mpl::reciprocal<type>::type

These aren't very interesting metafunctions, since they're all
equivalent to mpl::always<implementation_defined> ;-)

What is the reason for the trailing underscores?

> Obvious type for the type and exponent is a static_rational type. For pow_
> param order is same as runtime std::pow(x,y) , "root_" follows logically
> from pow_ .... but obviously ... pow_ could do the job) reciprocal also
> useful to represent 1/ type. I don't know enough mpl yet to provide
> generic examples except using the pqs types. If anyone else wants to have a
> go...? And of course docs :-) . Otherwise will get on with it asap.
>
> Feedback welcome.
>
> regards
> Andy Little
> ----------------------------------------------------------------
> headers:
>
> #ifndef BOOST_MPL_POW_HPP_INCLUDED
> #define BOOST_MPL_POW_HPP_INCLUDED
>
> namespace boost { namespace mpl{
>
> template <typename Type, typename Power>
> struct pow_ {
> typedef implementation_defined type

...


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