
In the program below, I expected the proto::lazy transform to call the times2() function, but it doesn't. It does work correctly if you substitute times2<int> for proto::_state. Is this a bug or am I forgetting something? Thanks, Dave Jenkins #include <iostream> #include <boost/proto/proto.hpp> #include <boost/proto/transform.hpp> namespace proto = boost::proto; template<typename T, typename Callable = proto::callable> struct times2 { typedef T result_type; T operator()(T i) const { std::cout << "Called times2()\n"; return i * 2; } }; struct IntTimes2 : proto::when< proto::terminal<proto::_> , proto::lazy<proto::_state(proto::_value) > //, proto::lazy<times2<int>(proto::_value) > > {}; int main() { int dummy = 0; proto::terminal<int>::type i = {1}; IntTimes2()(i, times2<int>(), dummy); }