opAssign and const?
Era Scarecrow
rtcvb32 at yahoo.com
Mon May 7 13:39:54 PDT 2012
>> On Saturday, May 05, 2012 05:50:26 Era Scarecrow wrote:
>>> Hmm maybe it should have a preference for Lvalue vs Rvalue...
>>> So... Walter or Andrei?
>>>
>>> 1. no match
>>> 2. match with implicit conversions (Lvalue required)
>>> 3. match with conversion to const (Lvalue required)
>>> 4. match with implicit conversions
>>> 5. match with conversion to const
>>> 6. exact match
Thinking about this, perhaps it should attempt the following
order instead.
(Not sure of the no match here)
2. match with conversion to const (Lvalue required)
3. match with implicit conversions (Lvalue required)
4. match with conversion to const
5. match with implicit conversions
6. exact match
7. no match - Templates attempted
8. error?
Trying the more restrictive ones first. You can convert mutable
to const, but you can't turn it around without specific cast and
knowledge. If you think about it too, very little code will
likely be const, or ones that are const usually will be by
themselves so ordering isn't going to be as important.
More information about the Digitalmars-d
mailing list