Skip to content

Instantly share code, notes, and snippets.

@ufcpp
Created February 10, 2015 17:29
Show Gist options
  • Save ufcpp/2ab14318229e8d4e63fa to your computer and use it in GitHub Desktop.
Save ufcpp/2ab14318229e8d4e63fa to your computer and use it in GitHub Desktop.
tuple-to-tuple conversions
class Base {}
class Derived : Base {}
(Base x, Base y) a = (x: new Derived(), y: new Derived()); // covariance
(double sum, long count) b = (sum: 1, count: 2); // implicit conversion from int
(int s, int c) c = (sum: 1, count: 2); // renaming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment