This confused me at first, that obj::fn(arg) is equivalent to (obj::fn)(arg), not obj::(fn(arg)).
Intuitively narrated, the :: operator has higher precedence than function call operator, and obj::fn is a valid expression on its own, similar to obj.fn. Without such an example it looks to me like the binary form requires the function to be called in-place. Something like the following will work:
This confused me at first, that
obj::fn(arg)
is equivalent to(obj::fn)(arg)
, notobj::(fn(arg))
. Intuitively narrated, the::
operator has higher precedence than function call operator, andobj::fn
is a valid expression on its own, similar toobj.fn
. Without such an example it looks to me like the binary form requires the function to be called in-place. Something like the following will work: