M
mlt
I have a function that returns a type T:
T f(){
T t;
....
if(something){
return;
}
....
return t;
}
But first it checks for some conditions and returns if they are not
fullfilled. The problem is that I have declared the function to return type
T so I can't just make it return "nothing".
Is there at way to return from a function without returning a value?
T f(){
T t;
....
if(something){
return;
}
....
return t;
}
But first it checks for some conditions and returns if they are not
fullfilled. The problem is that I have declared the function to return type
T so I can't just make it return "nothing".
Is there at way to return from a function without returning a value?