Lambda patch to enable *_1 for smart pointers

I've taken the liberty to apply the following patch to boost/lambda/detail/operator_return_type_traits.hpp: *** 19,24 **** --- 19,26 ---- #include "boost/lambda/detail/is_instance_of.hpp" #include "boost/type_traits/same_traits.hpp" + #include "boost/indirect_reference.hpp" + #include <cstddef> // needed for the ptrdiff_t #include <iosfwd> // for istream and ostream *************** *** 221,227 **** // A is a nonreference type template <class A> struct contentsof_type { ! typedef typename std::iterator_traits<A>::reference type; }; // this is since the nullary () in lambda_functor is always instantiated --- 223,229 ---- // A is a nonreference type template <class A> struct contentsof_type { ! typedef typename boost::indirect_reference<A>::type type; }; // this is since the nullary () in lambda_functor is always instantiated This (hopefully) makes *_1 work for smart pointers. Feel free to revert the patch if it breaks something; I don't have a full regression test system set up. -- Peter Dimov http://www.pdimov.com

"Peter Dimov" <pdimov@mmltd.net> writes:
I've taken the liberty to apply the following patch to boost/lambda/detail/operator_return_type_traits.hpp:
<snip>
// A is a nonreference type template <class A> struct contentsof_type { ! typedef typename boost::indirect_reference<A>::type type;
You're welcome ;-)
// this is since the nullary () in lambda_functor is always instantiated
This (hopefully) makes *_1 work for smart pointers.
Feel free to revert the patch if it breaks something; I don't have a full regression test system set up.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams
-
Peter Dimov