Update UsingForDirective docstring

This commit is contained in:
wechman 2022-08-02 11:17:58 +02:00
parent 9e1ba093d5
commit c61d5b457e

View File

@ -649,11 +649,15 @@ private:
* 2. `using LibraryName for *` attaches to all types.
* 3. `using {f1, f2, ..., fn} for T` attaches the functions `f1`, `f2`, ...,
* `fn`, respectively to `T`.
* 4. `using {f1 as op1, f2 as op2, ..., fn as opn} for T` bounds operator `opn` to function `fn` for type `T`.
*
* For version 3, T has to be implicitly convertible to the first parameter type of
* all functions, and this is checked at the point of the using statement. For versions 1 and
* 2, this check is only done when a function is called.
*
* For version 4, T has to be user-defined value type or struct. All parameters and
* return value of all the functions has to be of type T.
*
* Finally, `using {f1, f2, ..., fn} for T global` is also valid at file level, as long as T is
* a user-defined type defined in the same file at file level. In this case, the methods are
* attached to all objects of that type regardless of scope.