
MB wrote:
Eric Niebler wrote:
I agree that's not good. I've reimplemented the has_cheap_copy customization point again. See below.
Just an update on this issue... BOOST_FOREACH has recently received a face-lift, and this customization point has been renamed. It is now called is_lightweight_proxy, which refects the fact that this optimization can only legally be applied for proxies (like iterator pairs). In addition, there is a is_noncopyable customization point, which is needed to prevent BOOST_FOREACH from generating code that won't compile. (If your type derives from boost::noncopyable, is_noncopyable defaults to true; it's false otherwise.) Finally, this is now part of BOOST_FOREACH's documentation. Huzzah. -- Eric Niebler Boost Consulting www.boost-consulting.com