Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2006-05-16 08:52:53

Joel de Guzman wrote:
> Yet another frame thought that I've come to consider recently is
> to altogether discard the notion of "half runtime pair" and simply
> gravitate towards std::pair or any structure that conforms to the
> STL concept. For typical uses of fusion::map, for example, one can
> simply use boost::compressed_pair which automatically optimizes
> away the key or the data part (typically the key). The disadvantages
> of this approach are:

I found Fusion pairs broadly useful, not just for map entries.
They certainly feel much more intuitive than one would guess
reading the documentation.

> 1) boost::compressed_pair is needlessly more expensive (at compile
> time) than fusion::pair
> 2) The key type cannot be forward declared.

A pretty heavy downside, IMO:

1) Fusion is applicable in a variety of places, so if it becomes
one of the basic building blocks for other Boost libraries, it
might end up being used in lots of translation units for larger
Since the negative impact on compilation performance scales linear
with the project size, the library should stay as fast as possible.

2) Using undefined types for tagging (and thus for map keys) should
be common practice.



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