Copy Constructor DIP and implementation

rmc rjmcguire at gmail.com
Mon Sep 17 13:30:24 UTC 2018


On Wednesday, 12 September 2018 at 16:40:45 UTC, Jonathan M Davis 
wrote:
> [snip]
> Personally, I'd rather that we just risk the code breakage 
> caused by not having an attribute for copy constructors than 
> use either @implicit or @copy, since it really only risks 
> breaking code using constructors that were intended to be copy 
> constructors but had to be called explicitly, and that code 
> would almost certainly be fine if copy constructors then became 
> implicit, but Andrei seems unwilling to do that. [snip]
> - Jonathan M Davis

I'd also vote for no attribute for copy constructors and have a 
tool to warn us of changes across compiler versions that can 
detect constructors that look like copy constructors.

If dub keeps track of the dmd compiler version we could even have 
automated warnings for all dub packages.

This would also start us on the road towards a tool that allows 
us to make breaking changes. At first the tool could just warn 
us. Then we could slowly add automated code transforms.

Pretty sure this sort of tool has been mentioned before. This 
seems like a good use-case.

R


More information about the Digitalmars-d-announce mailing list