Universal Function Call Syntax
You will get to learn about universal function call syntax (UFCS) in this lesson.
We'll cover the following...
Universal function call syntax (UFCS)
UFCS is a feature that is applied by the compiler automatically. It enables the member function syntax even for regular functions. It can be explained simply by comparing two expressions:
variable.foo(arguments)
When the compiler encounters an expression like the one above, if there is no member function named foo
that can be called on a variable with the provided arguments, ...