> Am 22.12.2015 um 05:43 schrieb Matthew Johnson via swift-evolution 
> <[email protected]>:
> 
> What do you think the downsides are of synthesizing memberwise initialization 
> for properties with an “initial value”?  

When using the memberwise initializer those properties are always assigned a 
value twice. First the initial value and then the value provided by the 
initializer. The first value is constructed and assigned unnecessarily and in 
corner cases this might even be problematical, e.g. if creating a value of a 
certain kind has a side effect like incrementing an instance counter or logging 
something.

-Thorsten 
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to