DIP29: implicit conversion of pointer expressions#3319
Conversation
|
Just ignore the testCols.d thing, it's just that damned CRLF problem again that git thinks is different but is not. |
test/runnable/implicit.d
Outdated
There was a problem hiding this comment.
This line will make an invalid pointer. I think we should avoid any undefined behaviors even in trivial test cases, if it's not intended.
|
Note that, CRLF fix for testCols.d is already done #3307 in git head.so just you can remove the commit. |
src/cast.c
Outdated
There was a problem hiding this comment.
Alternatively, change this to return void and use t and result member variables.
Great, but I have no idea how to do that. |
|
|
@yebblies that worked like a champ! You da man! |
There was a problem hiding this comment.
Why tail immutable instead of full immutable? The immutableness of the head shouldn't make any difference here...
There was a problem hiding this comment.
Either way works, but I wished to make it clear that what matters with pointer conversions is what is pointed to, not the pointer itself.
There was a problem hiding this comment.
I don't think this is clearer. Put that note in a comment instead of complicating the code (and making it slower).
|
I should add that this should work like a pure function: |
Only when |
|
Should have a bugzilla report, not just a DIP. |
|
Sorry, should be: @yebblies , the last time everyone said it should be a dip. |
Having a DIP is great, but you still need a bugzilla entry for the changelog. |
|
Looks good. |
|
Auto-merge toggled on |
DIP29: implicit conversion of pointer expressions
This implements implicit conversions of (ptr+offset) expressions so that the ptr part determines if the expression is implicitly convertible.
This is a reboot of #1700
http://wiki.dlang.org/DIP29