[chrono] patch for VC9 duration conversions

Currently the enable_if expressions that restrict implicit duration type conversion to only conversions that will not reduce resolution are disabled on VC9 because they trigger a compiler error. I have come up with a slight adjustment to the expression that VC9 appears to be able to digest more favorably. Attached is a patch. I also opened ticket 5214 in Trac with this information. Vincent, if the patch looks good, let me know if you want to apply it or if you would like me to. -Dave

David Deakins wrote:
Currently the enable_if expressions that restrict implicit duration type conversion to only conversions that will not reduce resolution are disabled on VC9 because they trigger a compiler error. I have come up with a slight adjustment to the expression that VC9 appears to be able to digest more favorably. Attached is a patch. I also opened ticket 5214 in Trac with this information. Vincent, if the patch looks good, let me know if you want to apply it or if you would like me to.
-Dave
Hi, thanks for looking at this VC9 issue. And congratulation for the first Chrono ticket I'm aware off :) I was unable to find out why VC9 had some problems with these enable_if expressions. I see that you have removed 2 cases, but there are others. Have you tried to analyze them? The patch seem good to me except that we are adding a ratio detail. Maybe it will be better to add the is_evenly_divisible_by metafunction in the details of Boost.Chrono for the moment. Please be free to apply the patch yourself. I will try to see if similar workarounds can solve the other cases. Many thanks Dave, Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/chrono-patch-for-VC9-duration-conversions... Sent from the Boost - Dev mailing list archive at Nabble.com.

Hi Vicente, I had actually only looked at the VC9 issues that were directly causing test failures for the chrono test suite, so I hadn't noticed the other VC9-related ifdefs. However, I went through those files and removed all the ifdefs and I do not see any failures or compiler crashes. Is it possible that refactoring elsewhere in the code has made most of these fixes no longer necessary? Attached is a broader patch with my initial changes plus: - is_evenly_divisible_by is now moved from ratio_detail to a chrono_detail in a new file chrono/detail/is_evenly_divisible_by.hpp - the other VC9-related ifdefs have been removed. Let me know if you think this is good to apply to the trunk. Thanks, -Dave On 2/23/2011 5:40 AM, Vicente Botet wrote:
Hi,
thanks for looking at this VC9 issue. And congratulation for the first Chrono ticket I'm aware off :)
I was unable to find out why VC9 had some problems with these enable_if expressions.
I see that you have removed 2 cases, but there are others. Have you tried to analyze them?
The patch seem good to me except that we are adding a ratio detail. Maybe it will be better to add the is_evenly_divisible_by metafunction in the details of Boost.Chrono for the moment.
Please be free to apply the patch yourself. I will try to see if similar workarounds can solve the other cases.
Many thanks Dave, Vicente

David Deakins wrote:
Hi Vicente,
I had actually only looked at the VC9 issues that were directly causing test failures for the chrono test suite, so I hadn't noticed the other VC9-related ifdefs. However, I went through those files and removed all the ifdefs and I do not see any failures or compiler crashes. Is it possible that refactoring elsewhere in the code has made most of these fixes no longer necessary?
Attached is a broader patch with my initial changes plus:
- is_evenly_divisible_by is now moved from ratio_detail to a chrono_detail in a new file chrono/detail/is_evenly_divisible_by.hpp - the other VC9-related ifdefs have been removed.
Let me know if you think this is good to apply to the trunk.
Yes, please go ahead and thanks again, Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/chrono-patch-for-VC9-duration-conversions... Sent from the Boost - Dev mailing list archive at Nabble.com.
participants (2)
-
David Deakins
-
Vicente Botet