4 ms·
https://godbolt.org/z/d4838K https://godbolt.org/z/d4838K Doesn't happen, apparently. edit: For a short while libc++ adopted mpark's variant visit, which AFAI
by steerablesafe 6y ago
https://godbolt.org/z/d4838K https://godbolt.org/z/d4838K
Doesn't happen, apparently.
edit: For a short while libc++ adopted mpark's variant visit, which AFAIK compiles down to switch case with some hand coding. AFAIK it had other problems so they rolled back to the constexpr array of function pointers.
https://github.com/mpark/variant https://github.com/mpark/variant
- sesuximo 6y agoIf you call foo with an int or with a double, then it gets inlined. I don’t think they can inline foo as you’ve written it because the variant could be valueless by exception.