File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,17 @@ This library is an experiment and not intended for use. See the
57
57
58
58
## Nitty gritty.
59
59
60
- 1 . No public constructors, except for the default constructor. All other
61
- construction is through (named) static methods.
60
+ 1 . No public constructors, except for the default constructor and an aggregate
61
+ constructor of all fields. All other construction is through (named) static
62
+ methods.
63
+ * The aggregate constructor acts like the implicit constructor in cases
64
+ where it does not exist. It takes values for and initializes all data
65
+ members in the order they are declared.
62
66
* Non-default constructors are prefixed with ` with_() ` unless there's a
63
67
clear and better domain-specific name.
64
- * Would like to extend this to Copy and Move constructors too, through ` Clone `
65
- and ` Move ` methods. Implementation details required.
68
+ * Avoid writing copy constructors in non-containers unless copying is so
69
+ cheap you would pass the argument by value. Instead write Clone.
70
+ Containers have a copy constructor if their inner type has one.
66
71
* Write a ` ::from(x) ` constructing method to implement
67
72
` sus::construct::From ` when the type is constructed from another type.
68
73
* Exception granted for closure types (Fn, FnMut, FnOnce) because
You can’t perform that action at this time.
0 commit comments