Click here to Skip to main content
15,918,808 members
Home / Discussions / C#
   

C#

 
QuestionMulti-thread form managing [modified] Pin
natsuyaki11-May-08 4:20
natsuyaki11-May-08 4:20 
AnswerRe: Multi-thread form managing Pin
Ennis Ray Lynch, Jr.11-May-08 12:54
Ennis Ray Lynch, Jr.11-May-08 12:54 
GeneralRe: Multi-thread form managing Pin
natsuyaki11-May-08 14:29
natsuyaki11-May-08 14:29 
GeneralRe: Multi-thread form managing Pin
natsuyaki11-May-08 18:50
natsuyaki11-May-08 18:50 
QuestionOpening .xls file in Excel from C# Pin
eyalbi00711-May-08 3:35
eyalbi00711-May-08 3:35 
AnswerRe: Opening .xls file in Excel from C# Pin
Gareth H11-May-08 4:41
Gareth H11-May-08 4:41 
AnswerRe: Opening .xls file in Excel from C# Pin
Ed.Poore11-May-08 9:46
Ed.Poore11-May-08 9:46 
AnswerRe: Opening .xls file in Excel from C# Pin
Jimmanuel11-May-08 15:05
Jimmanuel11-May-08 15:05 
QuestionSystem Error mgs and flickering issue.... Pin
ASysSolvers11-May-08 3:03
ASysSolvers11-May-08 3:03 
Questiongenerics question Pin
George_George10-May-08 22:35
George_George10-May-08 22:35 
AnswerRe: generics question Pin
carbon_golem11-May-08 7:25
carbon_golem11-May-08 7:25 
GeneralRe: generics question Pin
George_George11-May-08 15:18
George_George11-May-08 15:18 
GeneralRe: generics question Pin
S. Senthil Kumar11-May-08 19:31
S. Senthil Kumar11-May-08 19:31 
GeneralRe: generics question Pin
George_George11-May-08 21:45
George_George11-May-08 21:45 
GeneralRe: generics question Pin
S. Senthil Kumar11-May-08 22:45
S. Senthil Kumar11-May-08 22:45 
GeneralRe: generics question Pin
George_George11-May-08 23:06
George_George11-May-08 23:06 
GeneralRe: generics question Pin
S. Senthil Kumar11-May-08 23:59
S. Senthil Kumar11-May-08 23:59 
GeneralRe: generics question Pin
George_George12-May-08 1:28
George_George12-May-08 1:28 
GeneralRe: generics question Pin
S. Senthil Kumar12-May-08 2:17
S. Senthil Kumar12-May-08 2:17 
George_George wrote:
1.

I want to confirm that the answer to my question #3 is, C# is using constraints to check whether a type is supported or not, but C++ will generate the specific type to check whether the operation is supported or not, right?


Yes, the C++ compiler compiles the expanded template as part of the normal compilation mechanism.


George_George wrote:
But from your sample below, I learned more. It seems C# compiler will check more than just the constraints, in your sample, without constraints, it will parse the invoked method to see whether it is supported, right?


Well, as part of compilation, it'll know that you called SayHello on the generic member, but it has no way of knowing whether the generic member has a SayHello. That's why it needs you to constrain the list of types that can be "substituted" for the generic member.

Regards
Senthil [MVP - Visual C#]
_____________________________
My Blog | My Articles | My Flickr | WinMacro

GeneralRe: generics question Pin
George_George12-May-08 2:32
George_George12-May-08 2:32 
QuestionFile header processing... [modified] Pin
natsuyaki10-May-08 22:00
natsuyaki10-May-08 22:00 
AnswerRe: File header processing... Pin
DanB198310-May-08 23:14
DanB198310-May-08 23:14 
GeneralRe: File header processing... Pin
natsuyaki10-May-08 23:34
natsuyaki10-May-08 23:34 
GeneralRe: File header processing... Pin
DanB198310-May-08 23:52
DanB198310-May-08 23:52 
GeneralRe: File header processing... Pin
natsuyaki10-May-08 23:59
natsuyaki10-May-08 23:59 

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.