| 203 | |
| 204 | template <typename T> |
| 205 | static handle cast(T &&src, return_value_policy policy, handle parent) { |
| 206 | if (!std::is_lvalue_reference<T>::value) { |
| 207 | policy = return_value_policy_override<Key>::policy(policy); |
| 208 | } |
| 209 | pybind11::set s; |
| 210 | for (auto &&value : src) { |
| 211 | auto value_ = reinterpret_steal<object>( |
| 212 | key_conv::cast(detail::forward_like<T>(value), policy, parent)); |
| 213 | if (!value_ || !s.add(std::move(value_))) { |
| 214 | return handle(); |
| 215 | } |
| 216 | } |
| 217 | return s.release(); |
| 218 | } |
| 219 | |
| 220 | PYBIND11_TYPE_CASTER(type, |
| 221 | io_name("collections.abc.Set", "set") + const_name("[") + key_conv::name |
no test coverage detected