Created
November 11, 2015 03:37
-
-
Save martindevans/880d53e40f3faba92d26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Key | |
: KeyTrait<ValueType> | |
// ^ ^ Type of the value this key supplies | |
// | Implement a trait indicating this is a key | |
{ | |
} | |
//usage | |
Key k = whatever(); //Get a key object | |
var value = dict.get(k); | |
// ^ Type of "value" is whatever the associated type "ValueType" is for the type "Key" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment