
4 Jul
2006
4 Jul
'06
9:42 p.m.
Bronek Kozicki wrote:
Tag is a type name recognized by compiler; you can declare it as many times and in as many locations as you wish. Important point about tag is that you have to declare it before you use it; compiler will enforce it. On the other hand, string is a literal; there is nothing compiler could check for you. Obviously, it means that while tags come with some coupling (although minimal - there is no need for "unified system" or "central location"), strings require no coupling at all.
I suspect there is something I'm missing. Let's use examples: // file1 struct tag1; set<tag1>(); // file2 struct tagl; get<tagl>(); // NULL How can the compiler know that you misspelled tag1 as tagl? It can't.