2 Mar
2019
2 Mar
'19
7:47 p.m.
On Fri, 1 Mar 2019 at 09:59, Peter Dimov via Boost
Kind of, but as written this implies that std::variant has no costs, which is not true. The checks for valueless do carry a cost. Each visit(), for example, starts with `if(valueless) throw`, which is not necessary in variant2.
That is not true. A typical implementation would just add an extra value to the switch, there is no extra branch.