Hi Boosters: In the document of boost::lambda (ar01s05.html#sect:nested_stl_algorithms), it says: ------------------>cited begin<------------------- Some aid for common special cases can be provided though. The BLL defines two helper function object classes, call_begin and call_end, which wrap a call to the begin and, respectively, end functions of a container, and return the const_iterator type of the container. With these helper templates, the above code becomes:
std::for_each(a.begin(), a.end(), bind(ll::for_each(), bind(call_begin(), _1), bind(call_end(), _1), protect(sum += _1))); ------------------->cited end<--------------------- But I failed to compile this example with gcc 3.2 and vc 2003 beta. I think the problem is, both struct call_begin and struct call_end dont provide a result_type. [lambda/algorithm.hpp] ------------------->cited begin<------------------- #define CALL_MEMBER(X) \ struct call_##X { \ template <class Args> \ struct sig { \ typedef typename boost::remove_const< \ typename boost::tuples::element<1, Args>::type \ >::type::const_iterator type; \ }; \ \ template<class T> \ typename T::const_iterator \ operator()(const T& t) const \ { \ return t.X(); \ } \ }; ------------------->cited end<--------------------- Is there anything I missed? And is there a possibel way to make these call_xxx run? -- <[EMAIL PROTECTED]> _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost