mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
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:
parent
391c75447d
commit
ebd6ad588b
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user