From: Andras Erdei (aerdei_at_[hidden])
Date: 2006-05-10 07:22:17
On 5/9/06, Tobias Schwinger <tschwinger_at_[hidden]> wrote:
> > Do you already have possible overloads and return types for convert() in
> > mind?
> Sure: 'convert' returns an expression, just like any other operator. That
> expression will be something like a reference wrapper for the argument.
> When the full compound expression is evaluated the convert expression
> protects its component expression from result type propagation.
> Best case, it's all it does -- the evaluation machinery can view the
> result of the evaluation as a value of the expected domain.
void f( rational const & ) ;
void f( integer const & ) ;
integer a , b ;
f( convert( a ) / b ) ;
what is going to happen ?
or do you expect end-users to provide overloads like
void f( integer_expression_stub const & ) ; ?
then they are bound to a particular implementation of integer.
am i missing something?
i am also not convinced the proposed evaluation mechanism is really useful:
it may look better than
rational r = rdiv( a , b ) ;
to some, but looks worse for others, and it goes against existing practice;
but maybe i'm just too conservative