diff --git a/lib/std/collections/tuple.c3 b/lib/std/collections/tuple.c3 index 053a52034..07dece104 100644 --- a/lib/std/collections/tuple.c3 +++ b/lib/std/collections/tuple.c3 @@ -12,7 +12,6 @@ struct Pair @require $assignable(self.first, $typeof(*a)) : "You cannot assign the first value to a" @require $assignable(self.second, $typeof(*b)) : "You cannot assign the second value to b" *> - macro void Pair.unpack(&self, a, b) { *a = self.first; @@ -28,6 +27,21 @@ struct Triple Type3 third; } +<* + @param [&out] a + @param [&out] b + @param [&out] c + @require $assignable(self.first, $typeof(*a)) : "You cannot assign the first value to a" + @require $assignable(self.second, $typeof(*b)) : "You cannot assign the second value to b" + @require $assignable(self.third, $typeof(*c)) : "You cannot assign the second value to c" +*> +macro void Triple.unpack(&self, a, b, c) +{ + *a = self.first; + *b = self.second; + *c = self.third; +} + module std::collections::tuple{Type1, Type2}; struct Tuple @deprecated("Use 'Pair' instead")