updates manual with codegenDecl on params docs (#22333)

* documents member

* Update doc/manual_experimental.md

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

---------

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
This commit is contained in:
Juan M Gómez
2023-08-17 11:20:22 +01:00
committed by GitHub
parent 299394d21a
commit 60307cc373

View File

@@ -2385,8 +2385,7 @@ Notice when calling a constructor in the section of a global variable initializa
Member pragma
=============
Similar to the `constructor` and `virtual` pragmas, the `member` pragma can be used to attach a `proc` or `func` to a type in C++.
It is more flexible than `virtual` in the sense that it accepts not only names but also operators or destructors.
Like the `constructor` and `virtual` pragmas, the `member` pragma can be used to attach a procedure to a C++ type. It's more flexible than the `virtual` pragma in the sense that it accepts not only names but also operators and destructors.
For example:
@@ -2439,4 +2438,4 @@ proc `()`(f: NimFunctor; n:int) {.importcpp: "#(@)" .}
NimFunctor()(1)
```
Notice we use the overload of `()` to have the same semantics in Nim, but on the `importcpp` we import the functor as a function.
This allows to easy interop with functions that accepts for example a `const` operator in its signature.
This allows to easy interop with functions that accepts for example a `const` operator in its signature.