[type_traits][units] migrating from ice_and
Hi! I've noticed that boost/type_traits/detail/ice_or.hpp and boost/type_traits/detail/ice_and.hpp have been deprecated. Both headers are used as an implementation detail in boost/units/scaled_base_unit.hpp, now resulting in lots of warnings: In file included from .../boost/units/scaled_base_unit.hpp:20: .../boost/type_traits/detail/ice_or.hpp:17:10: warning: NOTE: Use of this header (ice_or.hpp) is deprecated [-W#pragma-messages] # pragma message("NOTE: Use of this header (ice_or.hpp) is deprecated") Question: Is there a known migration path from type_traits to what? MPL? Or am I better off copying both files to Boost.Units and be done? Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! * voice: ++49 4257 300 ! Fährstraße 1 * fax : ++49 4257 300 ! 31609 Balge/Sebbenhausen * jhunold@gmx.eu ! Germany
On 5/27/2015 4:51 AM, Jürgen Hunold wrote:
Hi!
I've noticed that boost/type_traits/detail/ice_or.hpp and boost/type_traits/detail/ice_and.hpp have been deprecated. Both headers are used as an implementation detail in boost/units/scaled_base_unit.hpp, now resulting in lots of warnings:
In file included from .../boost/units/scaled_base_unit.hpp:20: .../boost/type_traits/detail/ice_or.hpp:17:10: warning: NOTE: Use of this header (ice_or.hpp) is deprecated [-W#pragma-messages] # pragma message("NOTE: Use of this header (ice_or.hpp) is deprecated")
Question: Is there a known migration path from type_traits to what? MPL? Or am I better off copying both files to Boost.Units and be done?
I do not know boost/units/scaled_base_unit.hpp, but the migration path is to use the '||' operator directly rather than 'ice_or' in the code. The only reason for the icexxx constructs were for ancient compilers which couldn't handle the equivalent operators directly but Boost no longer tests/supports those compilers.
On 27/05/2015 12:31, Edward Diener wrote:
On 5/27/2015 4:51 AM, Jürgen Hunold wrote:
Hi!
I've noticed that boost/type_traits/detail/ice_or.hpp and boost/type_traits/detail/ice_and.hpp have been deprecated. Both headers are used as an implementation detail in boost/units/scaled_base_unit.hpp, now resulting in lots of warnings:
In file included from .../boost/units/scaled_base_unit.hpp:20: .../boost/type_traits/detail/ice_or.hpp:17:10: warning: NOTE: Use of this header (ice_or.hpp) is deprecated [-W#pragma-messages] # pragma message("NOTE: Use of this header (ice_or.hpp) is deprecated")
Question: Is there a known migration path from type_traits to what? MPL? Or am I better off copying both files to Boost.Units and be done?
I do not know boost/units/scaled_base_unit.hpp, but the migration path is to use the '||' operator directly rather than 'ice_or' in the code. The only reason for the icexxx constructs were for ancient compilers which couldn't handle the equivalent operators directly but Boost no longer tests/supports those compilers.
Edward's correct - these were introduced as workarounds for VC6 - time to move on and use "real code" instead. BTW, it's on my TODO list to systematically supply PR's for all these outdated workarounds, I just haven't got there yet. Obviously if you fix it yourself first, that's even better ;-) HTH, John.
Hi John, Am Mittwoch, 27. Mai 2015, 13:47:29 schrieb John Maddock:
On 27/05/2015 12:31, Edward Diener wrote:
I do not know boost/units/scaled_base_unit.hpp, but the migration path is to use the '||' operator directly rather than 'ice_or' in the code. The only reason for the icexxx constructs were for ancient compilers which couldn't handle the equivalent operators directly but Boost no longer tests/supports those compilers.
Edward's correct - these were introduced as workarounds for VC6 - time to move on and use "real code" instead.
Thanks for the explanation. Yes, VC6 workarounds have to go.
BTW, it's on my TODO list to systematically supply PR's for all these outdated workarounds, I just haven't got there yet. Obviously if you fix it yourself first, that's even better ;-)
Well, my first version is at https://github.com/boostorg/units/pull/17 All tests for Boost.Units pass, but I'm double checking for any non-obvious mistakes. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! * voice: ++49 4257 300 ! Fährstraße 1 * fax : ++49 4257 300 ! 31609 Balge/Sebbenhausen * jhunold@gmx.eu ! Germany
Well, my first version is at
https://github.com/boostorg/units/pull/17
All tests for Boost.Units pass, but I'm double checking for any non-obvious mistakes. As far as I can tell it looks good to me, John.
participants (3)
-
Edward Diener
-
John Maddock
-
Jürgen Hunold