Using static_cast in boost::lambda

271 views Asked by At

I need to use boost::lambda for some conversion.

I've tried this:

static_cast<size_t>(boost::lambda::_1 * 60 * 1000)

But I've got error:

error C2440: 'static_cast' : cannot convert from 'const boost::lambda::lambda_functor' to 'size_t'

How to put this conversion inside of lambda?

1

There are 1 answers

0
sehe On BEST ANSWER

You can use boost::phoenix::static_cast_ instead (and I suggest using Phoenix for lambda expressions in general, assuming you're using c++03).

http://www.boost.org/doc/libs/1_57_0/boost/phoenix/object/static_cast.hpp