[DiscordArchive] Yeah possibly?
[DiscordArchive] Yeah possibly?
Archived author: Tea • Posted: 2024-09-10T12:30:18.388000+00:00
Original source
check assert msg
Archived author: MaxtorCoder • Posted: 2024-09-10T12:30:26.355000+00:00
Original source
`v.index() == I`
Archived author: Tea • Posted: 2024-09-10T12:30:32.184000+00:00
Original source
yep
Archived author: MaxtorCoder • Posted: 2024-09-10T12:30:34.871000+00:00
Original source
v = variant then I guess
![[Image: image.png?ex=690c94f5&is=690b4375&hm=f73...991e3b252&]](https://cdn.discordapp.com/attachments/376457124726702080/1283041977654448148/image.png?ex=690c94f5&is=690b4375&hm=f73f0938adddb0903fcc55e854b2c0872ffd0e27b803e5f7b31fdf7991e3b252&)
Archived author: MaxtorCoder • Posted: 2024-09-10T12:30:45.302000+00:00
Original source
Makes sense as well
![[Image: image.png?ex=690c94f5&is=690b4375&hm=f73...991e3b252&]](https://cdn.discordapp.com/attachments/376457124726702080/1283041977654448148/image.png?ex=690c94f5&is=690b4375&hm=f73f0938adddb0903fcc55e854b2c0872ffd0e27b803e5f7b31fdf7991e3b252&)
Archived author: Tea • Posted: 2024-09-10T12:30:47.512000+00:00
Original source
std::variant has index() method too
Archived author: Tea • Posted: 2024-09-10T12:34:19.801000+00:00
Original source
but yes, union is correct since std::variant is basically implemented as ```
struct variant {
union { types, template magic to create union of all template types } _storage;
index_type _index;
};``` where index_type varies depending on how many types are inside (but dont forget about alignment)
Archived author: MaxtorCoder • Posted: 2024-09-10T12:34:34.382000+00:00
Original source
Ah
Archived author: MaxtorCoder • Posted: 2024-09-10T12:34:45.538000+00:00
Original source
Makes sense
Archived author: MaxtorCoder • Posted: 2024-09-10T12:35:39.183000+00:00
Original source
Thanks