mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
fix has_shared_from_this any_cast
This commit is contained in:
parent
2d2503bbbb
commit
1ff8c97b1d
@ -73,8 +73,8 @@ namespace ngcore {
|
|||||||
};
|
};
|
||||||
#ifdef NETGEN_PYTHON
|
#ifdef NETGEN_PYTHON
|
||||||
info.anyToPyCaster = [](const std::any &a) {
|
info.anyToPyCaster = [](const std::any &a) {
|
||||||
if constexpr(has_shared_from_this<T>::value) {
|
if constexpr(has_shared_from_this2<T>::value) {
|
||||||
std::shared_ptr<T> val = std::any_cast<std::shared_ptr<T>>(&a);
|
std::shared_ptr<T> val = std::any_cast<std::shared_ptr<T>>(a);
|
||||||
return pybind11::cast(val);
|
return pybind11::cast(val);
|
||||||
} else {
|
} else {
|
||||||
const T* val = std::any_cast<T>(&a);
|
const T* val = std::any_cast<T>(&a);
|
||||||
|
Loading…
Reference in New Issue
Block a user