
On Dec 28, 2005, at 8:34 PM, Eric Niebler wrote:
You can help improve Boost.Foreach and Boost.Typeof for your favorite compiler! Read on.
Eric Niebler wrote:
Thorsten Ottosen wrote:
Now it works on vc7.1 too.
getting this to work with vc7.1 is a major advance. Thanks.
I am now using the compile-time-const-rvalue-detection trick in the new-and-improved BOOST_FOREACH. For the first time, it's passing its tests at 100% for VC7.1 and VC8. Also, const rvalues are being detected on gcc 3.4+ with zero runtime overhead. Very nice!
OK, now here's a simple thing anybody can do to improve Foreach and Typeof. Try compiling the attached file on your favorite compiler and report the results. I already know it works for VC7.1+ and gcc 3.4+. Everything else is up for grabs.
IBM Visual Age C++ version 6 and 7 gives the following compile time error: line 68.17: 1540-0135 (S) The array bound cannot be zero. Adding 1 to all the array sizes gives the following error: line 22.40: 1540-0704 (S) The definitions of "boost::mpl::and_<boost::mpl::not_<boost::is_array<foo>
,mpl_::bool_<1==sizeof((impl_::is_true(impl_::is_rvalue((1 ? impl_::make_probe(cf)..." and "boost::mpl::and_<boost::mpl::not_<boost::is_array<foo> ,mpl_::bool_<1==sizeof((impl_::is_true(impl_::is_rvalue((1 ? impl_::make_probe(mak..." have the same linkage signature "and___5impl_HQ3_5boost3mpl4not_XTQ2_5boost8is_arrayXT3foo__Q2_4mpl_5boo l_XSP0__PQ3_5boost3mpl4not_XTQ2_5boost8is_arrayXT3foo__PQ2_4mpl_5bo...".
Extra credit #1: If it doesn't compile for you, patch it so it does. :-)
Extra credit #2: Find a formulation that is 100% standard compliant. Back up your claim by citing references from the standard. :-)))
I'll do that when I find some time. Matthias