Tuple class and records in the Spring4D framework
Posted by jpluimers on 2021/07/01
The Spring Framework for Delphi has some cool tuple support.
The [WayBack] Tuple class has 3 create methods that build generic Tuple<> records with 2, 3 and 4 fields:
- [WayBack]
class function Create<T1, T2>(const value1: T1; const value2: T2): Tuple<T1, T2>; overload; static; inline;- [WayBack]
type Tuple<T1, T2> = record end;having fieldsValue1: T1,Value2: T2.
- [WayBack]
- [WayBack]
class function Create<T1, T2, T3>(const value1: T1; const value2: T2; const value3: T3): Tuple<T1, T2, T3>; overload; static; inline;- [WayBack]
type Tuple<T1, T2, T3> = record end;having fieldsValue1: T1,Value2: T2,Value3: T3.
- [WayBack]
- [WayBack]
class function Create<T1, T2, T3, T4>(const value1: T1; const value2: T2; const value3: T3; const value4: T4): Tuple<T1, T2, T3, T4>; overload; static; inline;- [WayBack]
type Tuple<T1, T2, T3, T4> = record end;having fieldsValue1: T1,Value2: T2,Value3: T3,Value4: T4.
- [WayBack]
–jeroen






Leave a comment