Skip to content

Instantly share code, notes, and snippets.

@soapyigu
Created April 28, 2018 22:00
Show Gist options
  • Save soapyigu/04f1942d4b957d5c11595f665321622c to your computer and use it in GitHub Desktop.
Save soapyigu/04f1942d4b957d5c11595f665321622c to your computer and use it in GitHub Desktop.
int main(int argc, const char * argv[]) {
@autoreleasepool {
Queue<Sub *> *subQueue = [[Queue alloc] init];
Queue<Sup *> *supQueue = subQueue; // Warning: Incompatible pointer types initializing 'Queue<Base *>' with an expression of type 'Queue<Sub *>'
[supQueue enqueue:[Sub new]];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment