Commit ebd6ad58 by Jason Rhinelander

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.
parent 391c7544
...@@ -61,8 +61,8 @@ for custom variant types: ...@@ -61,8 +61,8 @@ for custom variant types:
struct visit_helper<boost::variant> { struct visit_helper<boost::variant> {
template <typename... Args> template <typename... Args>
static auto call(Args &&...args) static auto call(Args &&...args)
-> decltype(boost::apply_visitor(std::forward<Args>(args)...)) { -> decltype(boost::apply_visitor(args...)) {
return boost::apply_visitor(std::forward<Args>(args)...); return boost::apply_visitor(args...);
} }
}; };
}} // namespace pybind11::detail }} // namespace pybind11::detail
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment