www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What principle difference between structure and Tuple?

reply Suliman <evermind live.ru> writes:
writeln(is(Tuple!(string, int) == struct)); // true

What is real user case where I should use Tuple instead of Struct?
Mar 10 2018
parent Steven Schveighoffer <schveiguy yahoo.com> writes:
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
Mar 13 2018