Best D way?

Frank Benoit keinfarbton at nospam.xyz
Sat Aug 12 18:14:27 PDT 2006


nobody_ schrieb:
> Hello,
> 
> What is the best way to let a function return multiple variables(of 
> different types)?
> Currently I use structures for this, but making special stuctures for this 
> can't be the best way.
> 
> Thanks. 
> 
> 

I think there not a 'best' way. I can think of three ways.
return a struct
'out' parameters values
pointer parameter (c-style)
object parameter (by reference, needs a class)

If you want to return 2 int, perhaps the out is the best.



More information about the Digitalmars-d-learn mailing list