Top "Return-value" questions

Return value is the result of evaluation of a return statement.

Return a const reference or a copy in a getter function?

What's better as default, to return a copy (1) or a reference (2) from a getter function? class foo { public: std::string …

c++ constants return-value
Which is more efficient: Return a value vs. Pass by reference?

I am currently studying how to write efficient C++ code, and on the matter of function calls, a question comes …

c++ performance function return-value pass-by-reference
What does "return {}" statement mean in C++11?

What does the statement return {}; in C++11 indicate, and when to use it instead of (say) return NULL; or return …

c++ c++11 return return-value list-initialization
Should I return bool or const bool?

Which is better: bool MyClass::someQuery() const; const bool MyClass::someQuery() const; I've been using 'const bool' since I'm sure …

c++ constants return-value
C++ -- return x,y; What is the point?

I have been programming in C and C++ for a few years and now I'm just now taking a college …

c++ c syntax return-value comma-operator
Avoiding copy of objects with the "return" statement

I have a very basic question in C++. How to avoid copy when returning an object ? Here is an example : …

c++ object copy return return-value
Can I find out the return value before returning while debugging in Eclipse?

Is it possible to see the return value of a method after the line has been run and before the …

java eclipse debugging return-value
perl - using backticks instead of system()

I have a perl script that calls an other perl script by using system() it's like: my $returnval= system("perl", $…

perl system return-value backticks
Can I avoid casting an enum value when I try to use or return it?

If I have the following enum: public enum ReturnValue{ Success = 0, FailReason1 = 1, FailReason2 = 2 //Etc... } Can I avoid casting when I return, …

c# .net enums casting return-value
Can a pointer (address) ever be negative?

I have a function that I would like to be able to return special values for failure and uninitialized (it …

c pointers return-value signed