Boost logo

Boost :

Subject: Re: [boost] [ratio][mpl] static metafunctions
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-12-31 04:13:28


----- Original Message -----
From: "Aleksey Gurtovoy" <agurtovoy_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, December 31, 2010 7:06 AM
Subject: Re: [boost] [ratio][mpl] static metafunctions

> On Thu, 30 Dec 2010 15:52:58 -0600, Dave Abrahams <dave_at_[hidden]>
> wrote:
>
>> At Thu, 30 Dec 2010 22:45:12 +0100,
>> vicente.botet wrote:
>>>
>>> Hi,
>>>
>>> during the Boost.Ratio review as requested to push some of the static
>>> integer metafunctions as static_abs, static_sign, static_gcd,
>>> static_lcm to a public library.
>>>
>>> At the begining I has the impression that these functions should be
>>> added to Boost.Integer or Boost.Math, but after reflexion I think that
>>> these static metafunctions could be better integrated into Boost.MPL
>>> with the existing integral functions. I have prepared a patch for 3 of
>>> them.
>>>
>>> Do you think that these can be added to Boost.MPL if I provide the
>>> needed documentation and tests?
>>>
>>
>> Looks good to me. Aleksey?
>
> I'd drop BOOST_MPL_CFG_MSVC_ETI_BUG workarounds since they are only
> relevant for MSVC < 7.1, otherwise yes, I will be happy to accept this
> (with tests and docs :).

OK. I will remove this part.

Otherwise, I needed to add a new BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2 because with BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC I got an compile error with MSVC.10 when passing the nested value to the template. As I have no tested it with other versions of MSVC I have just supposed that this doesn't works neither on older versions. I didn't change the exixting macro to make evident the difference.

+#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && ( defined(BOOST_MSVC) \
+ || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \
+ )
+
+# define BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC_2
+
+#endif

I will try to send the complete patch soon.

Thanks,
Vicente


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