简体   繁体   中英

Get return value of (static) function with no parameters C++

I have the following function:

content::mojom::CreateViewParamsPtr content::mojom::CreateViewParams::New() {
  CreateViewParamsPtr rv;
  mojo::internal::StructHelper<CreateViewParams>::Initialize(&rv);
  return rv;
} 

How can I get the return value if the function is called in my Main function as follows or at least show that the return value exists?

int PatrickMainChrome(int argc, const char** argv)  {

content::mojom::CreateViewParams::New();

return 0;

}
content::mojom::CreateViewParamsPtr myViewPtr = content::mojom::CreateViewParams::New();
//or shorter
auto myViewPtr = content::mojom::CreateViewParams::New();

如果在主函数中调用了函数,如何获得返回值

auto rv = content::mojom::CreateViewParams::New();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM