Advanced
C++
Q95 / 100
What is the ISO C++ hidden friend pattern?
Correct! Well done.
Incorrect.
The correct answer is B) Defining friend functions inside the class body, making them only findable via ADL, preventing unintended lookup in regular unqualified calls
B
Correct Answer
Defining friend functions inside the class body, making them only findable via ADL, preventing unintended lookup in regular unqualified calls
Explanation
Defining operator== as a friend inside the class hides it from normal lookup. It's only found via ADL (Argument-Dependent Lookup), preventing ambiguity with generic operators.
Progress
95/100