
17 Oct
2006
17 Oct
'06
7:57 p.m.
What if such a variant
represents a communication protocol which can contain one of enumerated message type instance. In this case the sender can not put there a message (per-compiler) which should not be there (not allowed). And a receiver can be 100% sure that it will not receive a message which should not be handled.
Yeah, sounds cool, until I actually tried as you suggested. Unfortunately, variants can only hold a few types, e.g. 20. For most interfaces I program, there are far more than 20 messages. But this concept is still intriguing. Since variant doesn't cut it for 100 messages, how could one use the typelist concept in this case? terry