boost::mpl:: operators ...power metafunction?
Hi, I am implementing the mpl math operators for my physical_quantities type. Ideally I would like to declare a boost::mpl::power metafunction. I would like to do: typedef Power_type<...> P ; pq_xx a; boost::mpl::power< pq_xx, P >::type b = run_time_power<P>( a); OTOH: boost::mpl::power< P, pq_xx >::type b = run_time_power<P>( a); (param order ... TBD) I am assuming it is ok to specialise plus, minus, multiplies etc in the boost::mpl namespace? I could of course put power (or whatever name) outside the boost::mpl namespace but that is not ideal. Any thoughts? regards Andy Little
Andy Little wrote:
Hi,
Hi Andy,
I am implementing the mpl math operators for my physical_quantities type. Ideally I would like to declare a boost::mpl::power metafunction. I would like to do:
typedef Power_type<...> P ; pq_xx a;
boost::mpl::power< pq_xx, P >::type b = run_time_power<P>( a);
OTOH: boost::mpl::power< P, pq_xx >::type b = run_time_power<P>( a); (param order ... TBD)
I am assuming it is ok to specialise plus, minus, multiplies etc in the boost::mpl namespace?
Yes, totally.
I could of course put power (or whatever name) outside the boost::mpl namespace but that is not ideal. Any thoughts?
If you contribute an implementation for it, I'd be happy to put the metafunction in the library. -- Aleksey Gurtovoy MetaCommunications Engineering
"Aleksey Gurtovoy"
Andy Little wrote:
[snip]
I could of course put power (or whatever name) outside the boost::mpl namespace but that is not ideal. Any thoughts?
If you contribute an implementation for it, I'd be happy to put the metafunction in the library.
OK. Will try to do a minimal generic implementation, some docs based on the existing mpl ones, and possibly include my useage as an example. regards Andy Little
participants (2)
-
Aleksey Gurtovoy
-
Andy Little