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.
diff --git a/docs/advanced/cast/stl.rst b/docs/advanced/cast/stl.rst
index ecd889f..ac6318f 100644
--- a/docs/advanced/cast/stl.rst
+++ b/docs/advanced/cast/stl.rst
@@ -61,8 +61,8 @@
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