Fix boost::variant example to not forward args

boost::apply_visitor accepts its arguments by non-const lvalue
reference, which fails to bind to an rvalue reference.  Change the
example to remove the argument forwarding.
This commit is contained in:
Jason Rhinelander 2017-08-07 15:48:49 -04:00
parent 391c75447d
commit ebd6ad588b

View File

@ -61,8 +61,8 @@ for custom variant types:
struct visit_helper<boost::variant> {
template <typename... Args>
static auto call(Args &&...args)
-> decltype(boost::apply_visitor(std::forward<Args>(args)...)) {
return boost::apply_visitor(std::forward<Args>(args)...);
-> decltype(boost::apply_visitor(args...)) {
return boost::apply_visitor(args...);
}
};
}} // namespace pybind11::detail