
Eric Niebler wrote:
I'm afraid you're out of luck, for now. Without access to this compiler, or knowledge of it's quirks, there's nothing I can do. I'll gladly accept a patch if you can make it work. The first thing I would try if I were you would be to change the line:
typedef mpl::bool_<value> type;
to
typedef mpl::bool_<is_range_base<T>::value> type;
That's all I can think of right now.
Well we're getting somewhere. That has made foreach.hpp compile. I have to #define BOOST_FOREACH_NO_CONST_RVALUE_DETECTION and a couple of examples I've tried now work. I haven't tried the tests (not sure how to run them easily) but this simple example compiles and runs (albeit with a load of compiler warnings about passing temporaries in to functions) BOOST_FOREACH( char ch, "Hello!" ) { std::cout << ch; } std::cout << std::endl; std::vector<int> v; BOOST_FOREACH(int& i, v) { i *= 2; std::cout << i << std::endl; } The compiler warnings are listed below. You can disable warnings temporarily on borland by #ifdef __BORLANDC__ # pragma option push -w-8032 #endif before the call and #ifdef __BORLANDC__ # pragma option pop #endif After the call. Don't know if you want to mess around with you code to do this or not. If i get the tests running, I'll report back with the details. Cheers Russell [C++] main.cpp(1): [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::mpl::false_ is_rvalue<char *>(char * &,int)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::foreach_detail_::type2type<char *,boost::mpl::false_> * encode_type<char *>(char * &)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::foreach_detail_::type2type<char *,boost::mpl::false_> * encode_type<char *>(char * &)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::mpl::false_ is_rvalue<char *>(char * &,int)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::foreach_detail_::type2type<char *,boost::mpl::false_> * encode_type<char *>(char * &)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::foreach_detail_::type2type<char *,boost::mpl::false_> * encode_type<char *>(char * &)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::mpl::false_ is_rvalue<char *>(char * &,int)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::foreach_detail_::type2type<char *,boost::mpl::false_> * encode_type<char *>(char * &)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::foreach_detail_::type2type<char *,boost::mpl::false_> * encode_type<char *>(char * &)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::foreach_detail_::type2type<char *,boost::mpl::false_> * encode_type<char *>(char * &)' [C++ Warning] main.cpp(14): W8032 Temporary used for parameter 1 in call to 'boost::foreach_detail_::boost::foreach_detail_::type2type<char *,boost::mpl::false_> * encode_type<char *>(char * &)'