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: os/src/README.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,8 @@
12
12
- functions are requested to be inlined assuming compilers won't adhere to the hint when it does not make sense, such as big functions called from multiple locations
13
13
- functions called from only one location should be inlined
14
14
*`const` is preferred and used where applicable
15
-
*`let` and `mut` are defined as `auto const` and `auto` and used to declare variables or constants
15
+
*`auto` is used when the type name is too verbose, such as iterators and templates; otherwise, types are spelled out for readability
16
+
*`let` and `mut` are defined as `auto const` and `auto` and can be used to declare variables and immutables
16
17
*`using namespace std;` is ok within namespace or implementation
17
18
* right to left notation `some_type const &inst` instead of `const some_type &inst`
18
19
- for consistency, `const` is written after the type such as `char const *ptr` instead of `const char *ptr` and `float const x` instead of `const float x`
0 commit comments