
20 Dec
2005
20 Dec
'05
10:24 p.m.
Edward Diener wrote:
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 ?
Good question. I'll see if I can work that out from the standard. -- Eric Niebler Boost Consulting www.boost-consulting.com