or std)
union (not working for classes I guess)
Why don't you benchmark yourself
That needs to rewrite a lot of code lines
void* is super unsafe. boost and std variant are safer, but I guess they have an abstraction overhead
Just create a test program that has a function that accepts void* and variant then see which is faster
void* can be used with a enum Type And casting depend on that
What about to make it as a class? With methods and ... That would be like variant yes?
Yes but remember if you use virtual dispatch, that has runtime overhead of lookup
Обсуждают сегодня