
Since I have problems with using grammars in my examples, I started from the lazy_vector example and see if I could incrementally change it to match my situation. As it is, the code doesn't compile for me. I had to make two changes, one trivial and one that I'd like to check with Eric. The trivial one is: template<typename Expr> result_type operator()( Expr const & expr, lazy_subscript_context & ctx ) const changed to: template<typename E> result_type operator()( E const & expr, lazy_subscript_context & ctx ) const in order not to shadow the outher Expr. This is an error in gcc, might be a warning with other compilers. The one I'd like to know about is this: template< typename T > struct lazy_vector : lazy_vector_expr< typename proto::terminal< std::vector<T> >::type > { typedef typename proto::terminal< std::vector<T> >::type expr_type; lazy_vector( std::size_t size = 0, T const & value = T() ) : lazy_vector_expr( expr_type::make( std::vector<T>( size, value ) ) ) {} .... which I had to change, mirroring the code in my integer-wrapping example, into: typedef lazy_vector_expr<typename proto::terminal< std::vector<T> >::type> expr_type; lazy_vector( std::size_t size = 0, T const & value = T() ) : expr_type( expr_type::type::make( std::vector<T>( size, value ) ) ) {} I have to say that I've no idea about what either really does, only that mine compiles. Even with these changes, the following line: v1 += v2 - v3; gives a ambiguity for the overload of operator +=. Eric, if you have a complete lazy_vector example that does compile, it would be helpful to put it in the test or example directory, so that people can avoid problems with extracting code from the documentation. Best regards, Maurizio