What principle difference between structure and Tuple?

Steven Schveighoffer schveiguy at yahoo.com
Tue Mar 13 13:33:58 UTC 2018


On 3/10/18 9:21 AM, Suliman wrote:
> writeln(is(Tuple!(string, int) == struct)); // true

That's because Tuple is a struct.

> 
> What is real user case where I should use Tuple instead of Struct?

When you want Tuple-like behavior? i.e. using indexes to access members.

-Steve


More information about the Digitalmars-d-learn mailing list