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
It looks like if you create a member function with a reference type, it fails to compile when you declare this class member function to Ponder. For example, suppose I add a member function as follows in the Ponder example with the person class.
void callByRef(int& a)
{
a = 10;
}
The declaration below would not compile.
.function("callByRef", &Person::callByRef)
/opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/functional:2434:5:
note: _Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = void; _ArgTypes = {Person&, int&}]
function<_Res(_ArgTypes...)>::
^
/opt/rh/devtoolset-3/root/usr/include/c++/4.9.1/functional:2434:5:
note: no known conversion for argument 2 from ?ponder::runtime::impl::ConvertArg<2, int&>::ReturnType {aka int}? to ?int&?
Is this documented? Why can it be supported?
-Shie-rei
The text was updated successfully, but these errors were encountered:
I'll try and find some time to look at it. In the meantime I can only suggest looking at the unit tests, which are fairly extensive, and source code.
I vaguely remember something about CAMP stripping the qualifiers from argument types. Part of the problem is that it has a generic calling mechanism and possibly types get coerced/simplified so the thing you think you are referencing is not what you think it is.
It looks like if you create a member function with a reference type, it fails to compile when you declare this class member function to Ponder. For example, suppose I add a member function as follows in the Ponder example with the person class.
The declaration below would not compile.
Is this documented? Why can it be supported?
-Shie-rei
The text was updated successfully, but these errors were encountered: