2 ms·
Not sure though why you justify the fact that you should'nt use singletons embedded in a struct because they are copied by reference? If it is a singleton, you
by oulipo 11y ago
Not sure though why you justify the fact that you should'nt use singletons embedded in a struct because they are copied by reference? If it is a singleton, you want it to be copied by reference. And you actually expect it to be since you want all the structs to refer to the same object?
You should not use an embedded class in a struct if it is not a singleton, as in the UIBezierPath example, where when you copy the struct, you expect to do a copy-on-write of the class to avoid mutating all copies in all structs