# 4.23 breaks my Async code...

**URL:** <https://forums.unrealengine.com/t/4-23-breaks-my-async-code/131550>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [September 27, 2019, 10:15am UTC](https://forums.unrealengine.com/t/4-23-breaks-my-async-code/131550 "2019-09-27T10:15:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsanjit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dsanjit](https://forums.unrealengine.com/u/dsanjit)\
**Post date:** [September 27, 2019, 10:15am UTC](https://forums.unrealengine.com/t/4-23-breaks-my-async-code/131550/1 "2019-09-27T10:15:26Z")

</div>

On upgrading to 4.23 the following doesnt compile:

```auto

 TFuture<void> ClientConnectionFinishedFuture;
...
ClientConnectionFinishedFuture = Async(EAsyncExecution::Thread, &](){
  ...
}); 

```

In fact the code in the Async doc doesnt compile as well:

```auto

TUniqueFunction<int()> Task = ]()
{
    return 123;
};
auto Result = Async(EAsyncExecution::Thread, Task);

```

//Error C2280 ‘TUniqueFunction\<void (void)\>::TUniqueFunction(const TUniqueFunction\<void (void)\> &)’: attempting to reference a deleted function

However I fixed it using TFunction instead of TUniqueFunction - not sure what the sideeffects ar ethough…

Sanjit

---

<div class="post-metadata">

**Author:** ![Emaer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/emaer/32/570877_2.png) [@Emaer](https://forums.unrealengine.com/u/Emaer)\
**Post date:** [September 27, 2019, 10:50am UTC](https://forums.unrealengine.com/t/4-23-breaks-my-async-code/131550/2 "2019-09-27T10:50:02Z")

</div>

**TUniqueFunction\<T\>** is non-copyable. You need to use explicit **move**.

---

<div class="post-metadata">

**Author:** ![YanDaik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YanDaik](https://forums.unrealengine.com/u/YanDaik)\
**Post date:** [December 1, 2019, 8:18pm UTC](https://forums.unrealengine.com/t/4-23-breaks-my-async-code/131550/3 "2019-12-01T20:18:05Z")

</div>

> [@Emaer](#):
>
> **TUniqueFunction\<T\>** is non-copyable. You need to use explicit **move**.

What does that mean? 🙂

---

<div class="post-metadata">

**Author:** ![Emaer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/emaer/32/570877_2.png) [@Emaer](https://forums.unrealengine.com/u/Emaer)\
**Post date:** [December 2, 2019, 4:56pm UTC](https://forums.unrealengine.com/t/4-23-breaks-my-async-code/131550/4 "2019-12-02T16:56:38Z")

</div>

[MoveTemp](https://docs.unrealengine.com/en-US/API/Runtime/Core/Templates/MoveTemp/index.html) should help.

```auto

TUniqueFunction<int()> Task = ](){ return 123; };

auto Result = Async(EAsyncExecution::Thread, MoveTemp(Task));

```
