diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index b1dc3f4af..3486af3ba 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -433,12 +433,10 @@ template class type_caster : public type template using make_caster = type_caster>; // Shortcut for calling a caster's `cast_op_type` cast operator for casting a type_caster to a T -template -auto cast_op(make_caster &caster) -> decltype(caster.operator typename make_caster::template cast_op_type()) { +template typename make_caster::template cast_op_type cast_op(make_caster &caster) { return caster.operator typename make_caster::template cast_op_type(); } -template -auto cast_op(make_caster &&caster) -> decltype(caster.operator typename make_caster::template cast_op_type()) { +template typename make_caster::template cast_op_type cast_op(make_caster &&caster) { return cast_op(caster); }