Skip to content

Commit ade3414

Browse files
committed
Add some style rules on when to have operator= and sus_pure_const
1 parent 3e2b4a3 commit ade3414

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

STYLE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,9 @@ footguns, crashes, bugs, and UB.
4343
* They don't mutate through a global or parameter mutable reference or pointer.
4444
* Thus they don't have observable side effects. Calling them on the same input
4545
values multiple times always produces the same output.
46+
* Additionally, if the function does not deref a pointer, access through
47+
a reference, or access any static variables, it may be marked
48+
`sus_pure_const`.
49+
1. If a type has implicit ctor from T then it should have assignment from T.
50+
The same is not true for an explicit ctor: no assignment should be present
51+
for that type.

0 commit comments

Comments
 (0)