Click here to Skip to main content
15,868,016 members
Home / Discussions / C#
   

C#

 
QuestionDirtying my hand with regular expression for first time Pin
tasumisra13-Feb-14 18:12
tasumisra13-Feb-14 18:12 
AnswerRe: Dirtying my hand with regular expression for first time Pin
OriginalGriff14-Feb-14 0:01
mveOriginalGriff14-Feb-14 0:01 
GeneralRe: Dirtying my hand with regular expression for first time Pin
tasumisra14-Feb-14 0:25
tasumisra14-Feb-14 0:25 
GeneralRe: Dirtying my hand with regular expression for first time Pin
OriginalGriff14-Feb-14 0:41
mveOriginalGriff14-Feb-14 0:41 
GeneralRe: Dirtying my hand with regular expression for first time Pin
Richard Deeming14-Feb-14 0:43
mveRichard Deeming14-Feb-14 0:43 
AnswerRe: Dirtying my hand with regular expression for first time Pin
tasumisra14-Feb-14 0:53
tasumisra14-Feb-14 0:53 
QuestionConcepts about Generics Pin
Richard Andrew x6413-Feb-14 8:23
professionalRichard Andrew x6413-Feb-14 8:23 
AnswerRe: Concepts about Generics Pin
Richard Deeming13-Feb-14 8:47
mveRichard Deeming13-Feb-14 8:47 
Possibly because they're not quite the same thing.

Key differences between generics and C++ templates:
  • Generics are generic until the types are substituted for them at runtime. Templates are specialized at compile time so they are not still parameterized types at runtime
  • The common language runtime specifically supports generics in MSIL. Because the runtime knows about generics, specific types can be substituted for generic types when referencing an assembly containing a generic type. Templates, in contrast, resolve into ordinary types at compile time and the resulting types may not be specialized in other assemblies.
  • Generics specialized in two different assemblies with the same type arguments are the same type. Templates specialized in two different assemblies with the same type arguments are considered by the runtime to be different types.
  • Generics are generated as a single piece of executable code which is used for all reference type arguments (this is not true for value types, which have a unique implementation per value type). The JIT compiler knows about generics and is able to optimize the code for the reference or value types that are used as type arguments. Templates generate separate runtime code for each specialization.
  • Generics do not allow non-type template parameters, such as template <int i> C {}. Templates allow them.
  • Generics do not allow explicit specialization (that is, a custom implementation of a template for a specific type). Templates do.
  • Generics do not allow partial specialization (a custom implementation for a subset of the type arguments). Templates do.
  • Generics do not allow the type parameter to be used as the base class for the generic type. Templates do.
  • Templates support template-template parameters (e.g. template<template<class T> class X> class MyClass), but generics do not.





"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Concepts about Generics Pin
Richard Andrew x6413-Feb-14 8:59
professionalRichard Andrew x6413-Feb-14 8:59 
QuestionWho can help me with this C# Project. Pin
horoz07413-Feb-14 7:05
horoz07413-Feb-14 7:05 
AnswerRe: Who can help me with this C# Project. Pin
Matt T Heffron13-Feb-14 7:15
professionalMatt T Heffron13-Feb-14 7:15 
GeneralRe: Who can help me with this C# Project. Pin
horoz07413-Feb-14 7:20
horoz07413-Feb-14 7:20 
QuestionRe: Who can help me with this C# Project. Pin
thatraja13-Feb-14 7:29
professionalthatraja13-Feb-14 7:29 
AnswerRe: Who can help me with this C# Project. Pin
horoz07413-Feb-14 7:32
horoz07413-Feb-14 7:32 
GeneralRe: Who can help me with this C# Project. Pin
thatraja13-Feb-14 7:47
professionalthatraja13-Feb-14 7:47 
QuestionDropDownlist keeps disappearing Pin
vkEE13-Feb-14 5:47
vkEE13-Feb-14 5:47 
SuggestionRe: DropDownlist keeps disappearing Pin
Richard MacCutchan13-Feb-14 7:03
mveRichard MacCutchan13-Feb-14 7:03 
QuestionOut of Memory error while generating TreeView Pin
Member 768043413-Feb-14 2:04
Member 768043413-Feb-14 2:04 
AnswerRe: Out of Memory error while generating TreeView Pin
Dave Kreskowiak13-Feb-14 2:35
mveDave Kreskowiak13-Feb-14 2:35 
AnswerRe: Out of Memory error while generating TreeView Pin
Eddy Vluggen13-Feb-14 2:59
professionalEddy Vluggen13-Feb-14 2:59 
AnswerRe: Out of Memory error while generating TreeView Pin
BillWoodruff13-Feb-14 3:24
professionalBillWoodruff13-Feb-14 3:24 
QuestionNumericString Sort Pin
Member 1059316812-Feb-14 20:52
Member 1059316812-Feb-14 20:52 
AnswerRe: NumericString Sort Pin
V.12-Feb-14 21:37
professionalV.12-Feb-14 21:37 
GeneralRe: NumericString Sort Pin
harold aptroot12-Feb-14 22:39
harold aptroot12-Feb-14 22:39 
AnswerRe: NumericString Sort Pin
DaveyM6912-Feb-14 23:37
professionalDaveyM6912-Feb-14 23:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.