Wield the Power of Generic Type Inference(kodefuguru.com)

submitted by KodefuGuruKodefuGuru(2818) 2 years, 5 months ago

One class that bothers me in the .NET Framework is KeyValuePair<K, V>. To create one these, you must explicitly declare the generic types being used. var pair = new KeyValuePair<int, string>(42, "The Answer");The .NET Framework support generic type inference, so why did the designer of the KeyValuePair<K, V> class decide it would be good idea to force us to write out the types? Take a look at another type of pair from .NET 4: the 2-valued Tuple.

add a comment |category: |Views: 10

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story