Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 210

Return instance by value from a method stack compilation

$
0
0

Can you explain why this won't compile:

(this is the error:

../Man.cpp:33:9: error: conversion from ‘Man (*)()’ to non-scalar type ‘Man’ requested)

Code:

Man goo(){  Man m();  return m;}

but this does:

Man goo(){    return Man();}

Viewing all articles
Browse latest Browse all 210

Trending Articles



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