Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-07-04 17:42:53


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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk