
Sorry for the noise. I found the solution. I modified too much when copying from ll_static_cast. If this were added to boost, would it more likely have to live in lambda or in any? This one works now: namespace boost { namespace lambda { template<class T> class any_cast_action; template<class T> class cast_action<any_cast_action<T> > { public: template<class RET, class Arg1> static RET apply(Arg1 &a1) { boost::any myany = a1; RET retval = any_cast<RET>(a1); return retval; } }; // any_cast template <class T, class Arg1> inline const lambda_functor< lambda_functor_base< action<1, cast_action<any_cast_action<T> > >, tuple<typename const_copy_argument <const Arg1>::type> > > ll_any_cast(const Arg1& a1) { return lambda_functor_base< action<1, cast_action<any_cast_action<T> >
, tuple<typename const_copy_argument <const Arg1>::type> > ( tuple<typename const_copy_argument <const Arg1>::type>(a1)); } } // namespace lambda } // namespace boost