mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
Update cast.h
This commit is contained in:
parent
8869be19d8
commit
b8336a8bb7
@ -685,10 +685,12 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
template <size_t... Is>
|
template <size_t... Is>
|
||||||
type implicit_cast(index_sequence<Is...>) & {
|
type implicit_cast(index_sequence<Is...>) & {
|
||||||
|
using std::get;
|
||||||
return type(cast_op<Ts>(get<Is>(subcasters))...);
|
return type(cast_op<Ts>(get<Is>(subcasters))...);
|
||||||
}
|
}
|
||||||
template <size_t... Is>
|
template <size_t... Is>
|
||||||
type implicit_cast(index_sequence<Is...>) && {
|
type implicit_cast(index_sequence<Is...>) && {
|
||||||
|
using std::get;
|
||||||
return type(cast_op<Ts>(std::move(get<Is>(subcasters)))...);
|
return type(cast_op<Ts>(std::move(get<Is>(subcasters)))...);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -696,6 +698,8 @@ protected:
|
|||||||
|
|
||||||
template <size_t... Is>
|
template <size_t... Is>
|
||||||
bool load_impl(const sequence &seq, bool convert, index_sequence<Is...>) {
|
bool load_impl(const sequence &seq, bool convert, index_sequence<Is...>) {
|
||||||
|
using std::get;
|
||||||
|
|
||||||
#ifdef __cpp_fold_expressions
|
#ifdef __cpp_fold_expressions
|
||||||
if ((... || !get<Is>(subcasters).load(seq[Is], convert))) {
|
if ((... || !get<Is>(subcasters).load(seq[Is], convert))) {
|
||||||
return false;
|
return false;
|
||||||
@ -714,6 +718,7 @@ protected:
|
|||||||
template <typename T, size_t... Is>
|
template <typename T, size_t... Is>
|
||||||
static handle
|
static handle
|
||||||
cast_impl(T &&src, return_value_policy policy, handle parent, index_sequence<Is...>) {
|
cast_impl(T &&src, return_value_policy policy, handle parent, index_sequence<Is...>) {
|
||||||
|
using std::get;
|
||||||
PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(src, policy, parent);
|
PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(src, policy, parent);
|
||||||
PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(policy, parent);
|
PYBIND11_WORKAROUND_INCORRECT_GCC_UNUSED_BUT_SET_PARAMETER(policy, parent);
|
||||||
std::array<object, size> entries{{reinterpret_steal<object>(
|
std::array<object, size> entries{{reinterpret_steal<object>(
|
||||||
|
Loading…
Reference in New Issue
Block a user