Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1015,14 +1015,14 @@ template <typename T> struct move_always<T, enable_if_t<all_of<
move_is_plain_type<T>,
negation<std::is_copy_constructible<T>>,
std::is_move_constructible<T>,
std::is_same<decltype(std::declval<type_caster<T>>().operator T&()), T&>
std::is_same<decltype(std::declval<make_caster<T>>().operator T&()), T&>
>::value>> : std::true_type {};
template <typename T, typename SFINAE = void> struct move_if_unreferenced : std::false_type {};
template <typename T> struct move_if_unreferenced<T, enable_if_t<all_of<
move_is_plain_type<T>,
negation<move_always<T>>,
std::is_move_constructible<T>,
std::is_same<decltype(std::declval<type_caster<T>>().operator T&()), T&>
std::is_same<decltype(std::declval<make_caster<T>>().operator T&()), T&>
>::value>> : std::true_type {};
template <typename T> using move_never = none_of<move_always<T>, move_if_unreferenced<T>>;

Expand Down
4 changes: 2 additions & 2 deletions include/pybind11/eigen.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct type_caster<Eigen::Ref<CVDerived, Options, StrideType>> {
protected:
using Type = Eigen::Ref<CVDerived, Options, StrideType>;
using Derived = typename std::remove_const<CVDerived>::type;
using DerivedCaster = type_caster<Derived>;
using DerivedCaster = make_caster<Derived>;
DerivedCaster derived_caster;
std::unique_ptr<Type> value;
public:
Expand All @@ -158,7 +158,7 @@ template <typename Type>
struct type_caster<Type, enable_if_t<is_eigen_base<Type>::value && !is_eigen_ref<Type>::value>> {
protected:
using Matrix = Eigen::Matrix<typename Type::Scalar, Eigen::Dynamic, Eigen::Dynamic>;
using MatrixCaster = type_caster<Matrix>;
using MatrixCaster = make_caster<Matrix>;
public:
[[noreturn]] bool load(handle, bool) { pybind11_fail("Unable to load() into specialized EigenBase object"); }
static handle cast(const Type &src, return_value_policy policy, handle parent) { return MatrixCaster::cast(Matrix(src), policy, parent); }
Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/functional.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct type_caster<std::function<Return(Args...) PYBIND11_NOEXCEPT_SPECIFIER>> {

PYBIND11_TYPE_CASTER(type, _("Callable[[") +
argument_loader<Args...>::arg_names() + _("], ") +
type_caster<retval_type>::name() +
make_caster<retval_type>::name() +
_("]"));
};

Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ struct vectorize_helper {
};

template <typename T, int Flags> struct handle_type_name<array_t<T, Flags>> {
static PYBIND11_DESCR name() { return _("numpy.ndarray[") + type_caster<T>::name() + _("]"); }
static PYBIND11_DESCR name() { return _("numpy.ndarray[") + make_caster<T>::name() + _("]"); }
};

NAMESPACE_END(detail)
Expand Down
4 changes: 2 additions & 2 deletions include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ class class_ : public detail::generic_type {
struct capture { Func func; };
capture *ptr = new capture { std::forward<Func>(func) };
install_buffer_funcs([](PyObject *obj, void *ptr) -> buffer_info* {
detail::type_caster<type> caster;
detail::make_caster<type> caster;
if (!caster.load(obj, false))
return nullptr;
return new buffer_info(((capture *) ptr)->func(caster));
Expand Down Expand Up @@ -1480,7 +1480,7 @@ template <return_value_policy Policy = return_value_policy::reference_internal,

template <typename InputType, typename OutputType> void implicitly_convertible() {
auto implicit_caster = [](PyObject *obj, PyTypeObject *type) -> PyObject * {
if (!detail::type_caster<InputType>().load(obj, false))
if (!detail::make_caster<InputType>().load(obj, false))
return nullptr;
tuple args(1);
args[0] = obj;
Expand Down