Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
C++
/
Operator overloading
Why can an expression a + b find operator+ defined as a friend inside the class of a and …
from Operator overloading
C++23
intermediate
1 min
Why can an expression a + b find operator+ defined as a friend inside the class of a and b?
Argument-dependent lookup adds the hidden friend as a candidate.
Every friend function is a private member function.
The compiler searches every class definition in the program.
friend changes the operator into a built-in operation.
Check
Ask AI about this kata
Report an error
previous kata
In C++23, what happens when a class defines auto operator<=>(const T&) const = default; a…
Quiz
next kata
What does this program print?
Predict the output
A new version is available
Reload