Skip to content

Commit

Permalink
docs: document the return type restrictions for operator overloading (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
thesombady committed Jan 14, 2024
1 parent cb22407 commit acf75c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/docs.md
Expand Up @@ -6191,6 +6191,8 @@ To improve safety and maintainability, operator overloading is limited.
- When overriding `<` and `==`, the return type must be strictly `bool`.
- Both arguments must have the same type (just like with all operators in V).
- Overloaded operators have to return the same type as the argument
(the exceptions are `<` and `==`).
#### Other restrictions
Expand Down

0 comments on commit acf75c7

Please sign in to comment.