
19 Dec
2005
19 Dec
'05
8:13 p.m.
Eric Niebler wrote:
Thorsten Ottosen wrote:
If I add const to the T() conversion, it suddenly works ok again.
Yes, that's because for the first line, there are two ways for the conversion to succeed. It could call operator T(), or it could call operator T&() followed by the standard lvalue-to-rvalue conversion.
Shouldn't operator T() be preferred because operator T&() requires an extra conversion ?