[foreach] Borland porters needed

BOOST_FOREACH is no longer working for any version of Borland. Any Borland users out there care to submit a patch and get their names in the acknowledgements? :-) -- Eric Niebler Boost Consulting www.boost-consulting.com

Hi,
From: Eric Niebler
BOOST_FOREACH is no longer working for any version of Borland. Any Borland users out there care to submit a patch
I've got Borland C++Builder 6.0 (compiler version 5.6.4) and can spend a bit of time on this. Could you give some details (e.g. where to get the version to patch from)? Best regards, Robert

Robert Kawulak wrote:
Hi,
From: Eric Niebler
BOOST_FOREACH is no longer working for any version of Borland.
Any
Borland users out there care to submit a patch
I've got Borland C++Builder 6.0 (compiler version 5.6.4) and can spend a bit of time on this. Could you give some details (e.g. where to get the version to patch from)?
Excellent. It's in Boost CVS. If that's not practical for you, you can also find a separate download inthe Boost File Vault at http://www.boost-consulting.com/vault/index.php?directory=Algorithms& TIA, -- Eric Niebler Boost Consulting www.boost-consulting.com

Eric Niebler wrote:
Robert Kawulak wrote:
Hi,
From: Eric Niebler
BOOST_FOREACH is no longer working for any version of Borland.
Any
Borland users out there care to submit a patch
I've got Borland C++Builder 6.0 (compiler version 5.6.4) and can spend a bit of time on this. Could you give some details (e.g. where to get the version to patch from)?
Excellent. It's in Boost CVS. If that's not practical for you, you can also find a separate download inthe Boost File Vault at http://www.boost-consulting.com/vault/index.php?directory=Algorithms&
TIA,
I am having problems with boost CVS, and no longer have clean copies to diff against. My bad. A first set of patches is that Borland are not coping well with the ellipses in boost_foreach_is_lightweight_proxy and boost_foreach_is_noncopyable. Suggest replacing them with a second template argument which can be deduced on this platform: [for_each.hpp, around line 150] #if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0X581)) template< typename T, typename U > inline boost::foreach::is_lightweight_proxy<T> * boost_foreach_is_lightweight_proxy(T *&, U ) { return 0; } #else template<typename T> inline boost::foreach::is_lightweight_proxy<T> * boost_foreach_is_lightweight_proxy(T *&, ...) { return 0; } #endif and [for_each.hpp, around line 170] #if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0X581)) template< typename T, typename U > inline boost::foreach::is_noncopyable<T> * boost_foreach_is_noncopyable(T *&, U ) { return 0; } #else template<typename T> inline boost::foreach::is_noncopyable<T> * boost_foreach_is_noncopyable(T *&, ...) { return 0; } #endif I tried using const ref for U initially, but that gives ambiguity errors. This does not solve all problems, but seems a reasonable first step. -- AlisdairM

AlisdairM wrote:
I tried using const ref for U initially, but that gives ambiguity errors.
This does not solve all problems, but seems a reasonable first step.
In fact, it solves most the problems apart from the array and string cases, which I think are the familiar Borland pointer decay issues. Did these ever work with a previous version of for_each? If so, how did you solve pointer-decay issues then? -- AlisdairM

AlisdairM wrote:
AlisdairM wrote:
I tried using const ref for U initially, but that gives ambiguity errors.
This does not solve all problems, but seems a reasonable first step.
In fact, it solves most the problems apart from the array and string cases, which I think are the familiar Borland pointer decay issues. Did these ever work with a previous version of for_each? If so, how did you solve pointer-decay issues then?
Wonderful. In fact, I don't think the elipses are needed at all, so a better patch would be to simply replace the ... with boost::foreach::tag and let overload resolution do its thing. I know at one point, BOOST_FOREACH worked on Borland with arrays and strings. I remember the pain, and see the vestigal work-arounds still in the code. We can confirm with the version from November once CVS is back up.) -- Eric Niebler Boost Consulting www.boost-consulting.com

Eric Niebler wrote:
I know at one point, BOOST_FOREACH worked on Borland with arrays and strings. I remember the pain, and see the vestigal work-arounds still in the code. We can confirm with the version from November once CVS is back up.)
You know, I just ran the regression tests and it passed with warnings! Fails in the IDE though - odd. Likewise, around half the tests are still failing in these results, despite passing in the IDE. Will investigate further. -- AlisdairM

AlisdairM wrote:
Eric Niebler wrote:
[...]
With the typo-fix below all tests pass with 5.6.4 and 5.6.5 (except the two expected failures). I was looking forward to some real BCC-bug-poking-fun, actually... ;-/ Anyway, OK to commit? Regards, Tobias // Borland needs a little extra help with arrays #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) template<typename T,std::size_t N> -inline T (*&to_ptr(T (&t)[N]))[N] +inline T (*&to_ptr(T (&)[N]))[N] { static T (*t)[N] = 0; return t;

Tobias Schwinger wrote:
With the typo-fix below all tests pass with 5.6.4 and 5.6.5 (except the two expected failures). I was looking forward to some real BCC-bug-poking-fun, actually... ;-/
Anyway, OK to commit?
Oh, yeah! OK to commit. Thanks Tobias! -- Eric Niebler Boost Consulting www.boost-consulting.com

Eric Niebler wrote:
Tobias Schwinger wrote:
With the typo-fix below all tests pass with 5.6.4 and 5.6.5 (except the two expected failures). I was looking forward to some real BCC-bug-poking-fun, actually... ;-/
Anyway, OK to commit?
Oh, yeah! OK to commit. Thanks Tobias!
It's in. Note, however, that I had to fix Boost.Range before I could get a single Foreach test compile (OK-to-commit is still pending, see my post few hours ago on that issue)...

Hi,
From: Tobias Schwinger
-inline T (*&to_ptr(T (&t)[N]))[N] +inline T (*&to_ptr(T (&)[N]))[N]
Confirm - I've also found the typo and after fixing it all the tests apart from rvalue are passed. I also tried to run the tests with Digital Mars - rvalue tests fail as well, and there are some problems with array tests too - I'll try to investigate this as soon as possible (but the problems with DM seem to be in range rather than foreach itself). Best regards, Robert
participants (4)
-
AlisdairM
-
Eric Niebler
-
Robert Kawulak
-
Tobias Schwinger