
This sentence from the doc Notable features of http://www.boost.org/doc/libs/1_38_0/doc/html/boost/variant.html boost::variant include: * Full value semantics, including adherence to standard overload resolution rules for conversion operations. * Compile-time type-safe value visitation via http://www.boost.org/doc/libs/1_38_0/doc/html/boost/apply_visitor.html boost::apply_visitor. is confusing to me. I was gonna ask if there was a purely compile-time visitor, but that doesn't make sense, as the instance of the variant can be assigned any of the bounded types at runtime. Regards, From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Ovanes Markarian Sent: 21 April 2009 15:25 To: boost-users@lists.boost.org Subject: Re: [Boost-users] boost variant compile time visitation: verification Hicham, visitation is not done at compile-time. Doc states as far as I remember that the compiler might (with high probability) inline the calls, so that they have similar performance as a switch statement. Switch usually equals to a jump in assembler. But there must be runtime overhead, since you put at runtime object instances into the variant. Greetings, Ovanes