[foreach] Can should_copy_impl return type be simplified?

I'm studying the implementation of foreach and I had a question about should_copy_impl. For reference, here's the overload that's vexing me: // If the collection is an array or is noncopyable, it must be an lvalue. // If the collection is a lightweight proxy, treat it as an rvalue // BUGBUG what about a noncopyable proxy? template<typename LValue, typename IsProxy> inline BOOST_DEDUCED_TYPENAME boost::enable_if<boost::mpl::or_<LValue, IsProxy>, IsProxy>::type * should_copy_impl(LValue *, IsProxy *, bool *) { return 0; } Why is enable_if needed? Can't the return type just be "IsProxy *"?

I believe there would be an ambiguous overload if the enable_if wasn't there. Thanks, Paul -- View this message in context: http://boost.2283326.n4.nabble.com/foreach-Can-should-copy-impl-return-type-... Sent from the Boost - Dev mailing list archive at Nabble.com.
participants (2)
-
Mostafa
-
pfultz2