You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to declare constructors and functions that take std::shared_ptr<U> argument, where U is a type that has been previously declared via ponder::Class::declare<U>. A small example test case is here. However, I'm running into template issues like the following:
In file included from test_ponder.cpp:2:
In file included from /usr/local/include/ponder/class.hpp:37:
In file included from /usr/local/include/ponder/property.hpp:35:
In file included from /usr/local/include/ponder/tagholder.hpp:36:
In file included from /usr/local/include/ponder/value.hpp:38:
/usr/local/include/ponder/detail/valueimpl.hpp:53:16: error: no viable conversion from returned value of type 'Test1' to function return type 'std::__1::shared_ptr'
return ponder_ext::ValueMapper::from(value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ponder/detail/variant.hpp:316:20: note: in instantiation of function template specialization 'ponder::detail::ConvertVisitor<std::__1::shared_ptr >::operator()' requested
here
return f(unwrapper::apply_const(v.template get_unchecked()));
[...]
I'm wondering whether I'm doing something wrong or whether there's missing support for smart pointer arguments.
The text was updated successfully, but these errors were encountered:
Ok, thanks! I think the issue is that the ValueMapper trait for smart pointers simply forwards the underlying type. I'd guess that the from functions would need to be reimplemented, but without further knowledge of ponder's internals I'm not sure what the right way to do this would be.
I've been trying to declare constructors and functions that take
std::shared_ptr<U>
argument, whereU
is a type that has been previously declared viaponder::Class::declare<U>
. A small example test case is here. However, I'm running into template issues like the following:I'm wondering whether I'm doing something wrong or whether there's missing support for smart pointer arguments.
The text was updated successfully, but these errors were encountered: