You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CODING_STYLE.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ Use `solAssert` and `solUnimplementedAssert` generously to check assumptions tha
119
119
4. Favour declarations close to use; don't habitually declare at top of scope ala C.
120
120
5. Pass non-trivial parameters as const reference, unless the data is to be copied into the function, then either pass by const reference or by value and use std::move.
121
121
6. If a function returns multiple values, use std::tuple (std::pair acceptable) or better introduce a struct type. Do not use */& arguments.
122
-
7. Use parameters of pointer type only if ``nullptr`` is a valid argument, use references otherwise. Often, ``boost::optional`` is better suited than a raw pointer.
122
+
7. Use parameters of pointer type only if ``nullptr`` is a valid argument, use references otherwise. Often, ``std::optional`` is better suited than a raw pointer.
123
123
8. Never use a macro where adequate non-preprocessor C++ can be written.
124
124
9. Only use ``auto`` if the type is very long and rather irrelevant.
125
125
10. Do not pass bools: prefer enumerations instead.
@@ -135,12 +135,12 @@ enum class Accuracy
135
135
};
136
136
struct MeanSigma
137
137
{
138
-
float mean;
139
-
float standardDeviation;
138
+
float mean = 0.0f;
139
+
float standardDeviation = 1.0f;
140
140
};
141
141
double const d = 0;
142
-
int i;
143
-
int j;
142
+
int i = 0;
143
+
int j = 0;
144
144
char* s;
145
145
MeanAndSigma ms meanAndSigma(std::vector<float> const& _v, Accuracy _a);
You can find our current feature and bug priorities for forthcoming releases [in the projects section](https://github.com/ethereum/solidity/projects).
0 commit comments