binary'*'instead of unary'*'or pinning pointers error
Posted: Tue Aug 25, 2009 3:33 am
Help me solve such a problem with pointers, which I can't for two days plz. I call one class method and pass it one structure argument as const reference. Then I try to use this structure member iterator on pointer on class by derefferenicng it
but get error message
though I tried use unary '*'. Manual tells that this error can "occur if you do not pin a native member before calling a member function on it".
I tried to use pin pointers but no one of two variants pass through the same error
I asked this question in beginners forum but nobody answered me for the period. Will be glad if you can help me
Code: Select all
struct SAbilityDrawParams
{
list<class CAbility *>::Iterator ab;
...
};
void CInterface::drawAbilityTones( const SAbilityDrawParams ¶ms )
{
if( (*params.ab)->selfTonesChange[t] > maxSelfToneCh )
...
}
Code: Select all
C2678 binary '*' : no operator defined which takes a left-hand operand of type 'const irr::core::list<T>::Iterator' (or there is no acceptable conversion)
I tried to use pin pointers but no one of two variants pass through the same error
Code: Select all
cli::pin_ptr<const list<CAbility *>::Iterator> p = ¶ms.ab;
const irr::core::list<CAbility *>::Iterator ab = *p;
if( (*ab)->targetTonesChange[t] < minTargToneCh )
Code: Select all
cli::pin_ptr<const list<CAbility *>::Iterator> p = ¶ms.ab;
if( (**p)->targetTonesChange[t] < minTargToneCh )