From ebd6ad588b6851d9dbf465b033b0f9d1acb4e54a Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Mon, 7 Aug 2017 15:48:49 -0400 Subject: [PATCH] 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. --- docs/advanced/cast/stl.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/advanced/cast/stl.rst b/docs/advanced/cast/stl.rst index ecd889ffb..ac6318f0e 100644 --- a/docs/advanced/cast/stl.rst +++ b/docs/advanced/cast/stl.rst @@ -61,8 +61,8 @@ for custom variant types: struct visit_helper { template static auto call(Args &&...args) - -> decltype(boost::apply_visitor(std::forward(args)...)) { - return boost::apply_visitor(std::forward(args)...); + -> decltype(boost::apply_visitor(args...)) { + return boost::apply_visitor(args...); } }; }} // namespace pybind11::detail