Top "Return-type" questions

is for questions dealing with the type of the variable or value returned by a function.

How to specify multiple return types using type-hints

I have a function in python that can either return a bool or a list. Is there a way to …

python python-3.x return-type type-hinting python-3.5
C# numeric enum value as string

I have the following enum: public enum Urgency { VeryHigh = 1, High = 2, Routine = 4 } I can fetch an enum "value" as string like …

c# enums return-value return-type
Return multiple values from a Java method: why no n-tuple objects?

Why isn't there a (standard, Java certified) solution, as part of the Java language itself, to return multiple values from …

java methods return-type
Is it safe to return a struct in C or C++?

What I understand is that this shouldn't be done, but I believe I've seen examples that do something like this (…

c++ c function struct return-type
What if I write return statement in constructor?

What if I write return statement in constructor? Is it standard conformant? struct A { A() { return; } }; The above code compiles …

c++ constructor return-value return return-type
How to return local array in C++?

char *recvmsg(){ char buffer[1024]; return buffer; } int main(){ char *reply = recvmsg(); ..... } I get a warning: warning C4172: returning address of …

c++ char return-type
Why do constructors in java not have a return type?

Possible Duplicate: Why constructor not returns value Why don't constructors have a return type, not even void? What's the reason …

java constructor return-type
Java generics void/Void types

I am implementing a ResponseHandler for the apache HttpClient package, like so: new ResponseHandler<int>() { public int handleResponse(...) { // ... …

java void return-type
Void as return type

I was testing return types with PHP 7. I've created a simple script to test return types of PHP 7: <?php …

php void return-type php-7
C++ virtual function return type

Is it possible for an inherited class to implement a virtual function with a different return type (not using a …

c++ inheritance virtual-functions overriding return-type