Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-05-10 10:56:07

"Arkadiy Vertleyb" <vertleyb_at_[hidden]> writes:

> "David Abrahams" <dave_at_[hidden]> wrote
>> > IOW, such templates in different translation units will be absolutely
> the
>> > same, although in each translation unit the compiler will have to
>> > instantiate different intermediate classes in order to produce them.
>> Right.
>> > Do you still think this should be a problem?
>> "_Should_ be?" no, I never did. I just think it's technically a
>> violation of the rules.
> I have to admit that the solution with automatic ID generation would
> probably be non-conformant.
> I guess the next question would be, if we require to manually provide a
> unique integer for each group of types/templates, how practical such system
> would be, especially considering the fact that an expression may contain
> types defined in multiple libraries, as well as user-defined types...
> Are there any known examples of libraries that requre users to provide
> unique compile-time integers?

Can't we do something with a unique name per header file using typeof?

#define BOOST_TYPEOF_HEADER boost_lambda_whatever

We could use that to define a uniquely-named type and/or synthesize
identifiers using __LINE__.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at