https://reviews.llvm.org/D15421
clang has __type_pack_element
which allows efficient indexing of parameter packs in variadic templates. Is there a GCC equivalent?
I am not interested in using tuple_element_t
. I am looking for an alternative that is a compiler primitive
If you are really brave/crazy you could try and use the same techniques as kvasir::mpl does for this problem. In metaben.ch benchmarks its the same or faster than others who use __type_pack_element and works on GCC (note that the benchmark looks at every element, if you just ever index a few it will look quite different but usually if you want one then you eventually want the others too).
benchmark
implementation
old blog post about it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With