Use rvalue casting

This commit is contained in:
Aaron Gokaslan 2022-06-14 14:21:32 -04:00 committed by GitHub
parent 3a74bc41ef
commit c3a313b0e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2269,7 +2269,7 @@ iterator object_api<D>::end() const {
template <typename D>
template <typename T>
item_accessor object_api<D>::operator[](T &&key) const {
return {derived(), reinterpret_borrow<object>(detail::object_or_cast(std::forward<T>(key)))};
return {derived(), detail::object_or_cast(std::forward<T>(key)).cast<object>()};
}
template <typename D>
obj_attr_accessor object_api<D>::attr(handle key) const {