mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 21:40:33 +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
|
||||
info.anyToPyCaster = [](const std::any &a) {
|
||||
if constexpr(has_shared_from_this<T>::value) {
|
||||
std::shared_ptr<T> val = std::any_cast<std::shared_ptr<T>>(&a);
|
||||
if constexpr(has_shared_from_this2<T>::value) {
|
||||
std::shared_ptr<T> val = std::any_cast<std::shared_ptr<T>>(a);
|
||||
return pybind11::cast(val);
|
||||
} else {
|
||||
const T* val = std::any_cast<T>(&a);
|
||||
|
Loading…
Reference in New Issue
Block a user