Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17070

[Callback issue] Cannot take the address of an rvalue of type 'void'

$
0
0

@pan1cmode wrote:

Hey there,
I am migrating from Unity to Cocos and stuck with a problem.
Trying to pass callback on event listener like this:

auto mButton = Button::create();
mButton->addClickEventListener(CC_CALLBACK_0(ElementsMatrix::BuildMatrix(), this));

Getting "Cannot take the address of an rvalue of type 'void'" (XCode)
Nothing special with method BuildMatrix():

void ElementsMatrix::BuildMatrix()
{
    CCLOG("Build is ready!");
}

I've read about rvalue, but it doesn't make any sense for me regarding to this problem. Any help?
Thanks!

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>