Top "Return-type" questions

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

PowerShell changes return object's type

I am using PowerShell v3 and the Windows PowerShell ISE. I have the following function that works fine: function Get-XmlNode([…

function powershell powershell-3.0 return-type powershell-ise
When is C++ covariance the best solution?

This question was asked here a few hours ago and made me realise that I have never actually used covariant …

c++ covariance return-type
How to return a string literal from a function

I am always confused about return a string literal or a string from a function. I was told that there …

c++ string literals return-type
Why should the assignment operator return a reference to the object?

I'm doing some revision of my C++, and I'm dealing with operator overloading at the minute, specifically the "="(assignment) operator. …

c++ operator-overloading return-type assignment-operator
How to get the return type of a method call in IntelliJ?

Normally you would expect just hovering over a method it would show a popup of the return type. How do …

java intellij-idea return-type
Should methods with return type void use a return statement?

I know that there are times when using return; can serve a useful purpose in Java, such as in guarding: …

java return-type
Java method with generic return Type

Is there a way in Java to return different types with one declaration of a method? public Object loadSerialized(String …

java generics casting return-type generic-method
overriding virtual function return type differs and is not covariant

Ah, SO came back just in time. I am getting a strange error: 'B::blah': overriding virtual function return type …

c++ covariance virtual-functions return-type object-slicing
How to specify method return type list of (what) in python?

Let's say I have a method like the following def validate(self, item:dict, attrs:dict)-> list: If …

python python-3.x return-type
SQL function return-type: TABLE vs SETOF records

What's the difference between a function that returns TABLE vs SETOF records, all else equal. CREATE FUNCTION events_by_type_1(…

sql postgresql return-type sql-function sql-types