Add unsafeIsolate and extract to std/isolation [backport:1.4] (#17263)
This commit is contained in:
parent
b2b23d723a
commit
19be5eb1eb
2 changed files with 10 additions and 0 deletions
|
|
@ -252,6 +252,8 @@ provided by the operating system.
|
||||||
|
|
||||||
- `--newruntime` and `--refchecks` are deprecated.
|
- `--newruntime` and `--refchecks` are deprecated.
|
||||||
|
|
||||||
|
- Added `unsafeIsolate` and `extract` to `std/isolation`.
|
||||||
|
|
||||||
## Tool changes
|
## Tool changes
|
||||||
|
|
||||||
- The rst parser now supports markdown table syntax.
|
- The rst parser now supports markdown table syntax.
|
||||||
|
|
|
||||||
|
|
@ -30,3 +30,11 @@ func isolate*[T](value: sink T): Isolated[T] {.magic: "Isolate".} =
|
||||||
## Please read https://github.com/nim-lang/RFCs/issues/244
|
## Please read https://github.com/nim-lang/RFCs/issues/244
|
||||||
## for more details.
|
## for more details.
|
||||||
Isolated[T](value: value)
|
Isolated[T](value: value)
|
||||||
|
|
||||||
|
func unsafeIsolate*[T](value: sink T): Isolated[T] =
|
||||||
|
## Creates an isolated subgraph from the expression `value`.
|
||||||
|
Isolated[T](value: value)
|
||||||
|
|
||||||
|
func extract*[T](src: var Isolated[T]): T =
|
||||||
|
## Returns the internal value of `src`.
|
||||||
|
result = move(src.value)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue