
Maurizio, I didn't see this message the first time because for some reason, all your messages appear out of order on GMane. Is the clock on your computer wrong? Is it something you can fix? Maurizio Vitale wrote:
I don't know if it is a bug or not, but I was surprised by the effect of a seemingly minor code change.
<snip>
So I said to myself: let's get rid of all those operators and replace them with a single templatized version, like:
template <typename Expr> struct my_expression : proto::extends<Expr, my_expression<Expr>, my_domain> { typedef proto::extends<Expr, my_expression<Expr>, my_domain> base_type;
my_expression (Expr const& expr = Expr()) : base_type (expr) {};
using base_type::operator =;
template<typename T> operator T () const { return static_cast<T>(proto::eval(*this, my_context<Expr> ())); } };
OK, your expression wrapper has an implicit conversion to any type T. That is, IMO, a bad idea, but nevertheless, proto shouldn't stop you from doing that. I think I have fixed the problem in CVS. Incidentally, you were running into an ambiguous conversion deep in the guts of callable_context, which uses an implicit conversion to a hidden type to detect whether your context has an overload of operator() that accepts the current expression. The code now uses a less-preferred conversion, avoiding the ambiguity with yours. -- Eric Niebler Boost Consulting www.boost-consulting.com