[DiscordArchive] why do we use a copy here?
[DiscordArchive] why do we use a copy here?
![[Image: image.png?ex=690c2f71&is=690addf1&hm=e2b...4a509a222&]](https://cdn.discordapp.com/attachments/376457124726702080/1303407893621768212/image.png?ex=690c2f71&is=690addf1&hm=e2b8590de2bcb0ce1fe0b7e9f912f1a46413236cbefcbf598452d7f4a509a222&)
Archived author: Telegrill • Posted: 2024-11-05T17:17:37.991000+00:00
Original source
why do we use a copy here?
![[Image: image.png?ex=690c2f71&is=690addf1&hm=e2b...4a509a222&]](https://cdn.discordapp.com/attachments/376457124726702080/1303407893621768212/image.png?ex=690c2f71&is=690addf1&hm=e2b8590de2bcb0ce1fe0b7e9f912f1a46413236cbefcbf598452d7f4a509a222&)
Archived author: Tea • Posted: 2024-11-05T17:17:56.104000+00:00
Original source
where do you see a copy
Archived author: Telegrill • Posted: 2024-11-05T17:20:13.230000+00:00
Original source
yeah, like passing it as a reference
Archived author: MaxtorCoder • Posted: 2024-11-05T17:20:18.433000+00:00
Original source
That is not a copy
Archived author: Telegrill • Posted: 2024-11-05T17:21:54.680000+00:00
Original source
isn't it a reference to the declaration of the array?
Archived author: Telegrill • Posted: 2024-11-05T17:22:02.664000+00:00
Original source
<:fry:770403425107443722>
Archived author: MaxtorCoder • Posted: 2024-11-05T17:22:06.467000+00:00
Original source
Yes a reference, not a copy.
word:770403424965492738>
Archived author: Telegrill • Posted: 2024-11-05T17:22:25.183000+00:00
Original source
that's my way of understanding <
word:770403424965492738>
Archived author: MaxtorCoder • Posted: 2024-11-05T17:22:27.817000+00:00
Original source
A copy would be
```cpp
for (auto const [poisonAura, debuffSpellId] : <container>)
```
Archived author: Telegrill • Posted: 2024-11-05T17:23:02.412000+00:00
Original source
that's a direct copy to me