id summary reporter owner description type status milestone component version severity resolution keywords cc 6971 apply_visitor doesn't work with rvalue / const variants adam.ciganek@… Antony Polukhin "Hello, I noticed the `apply_visitor` function doesn't work when the passed in variant is const or rvalue. This is because there is no overload accepting the variant via const reference. Is this deliberate, or is it an omission? In case this is an omission, the fix seems to be trivial. The `apply_visitor` function seems to simply forward to the internal `apply_visitor` member function of the variant type. There is already a const version of this member function in the boost::variant sources, so all that is needed is to add new free `apply_visitor` function that takes the variant parameter by const reference and call it's `apply_visitor` member. Something like this: {{{ template inline typename Visitor::result_type apply_visitor(Visitor& visitor, const Visitable& visitable) { return visitable.apply_visitor(visitor); } " Bugs closed Boost 1.66.0 variant Boost 1.49.0 Problem fixed