Boost logo

Boost :

Subject: Re: [boost] [unordered] Buffered functions?
From: Daniel James (daniel_james_at_[hidden])
Date: 2008-11-24 11:44:54

2008/11/24 Thorsten Ottosen <thorsten.ottosen_at_[hidden]>:
> 1. storing two functors had to do with implementing exception safety if
> copying of the functors may throw. Was it swap() that was the problem?

Here's the original post where I described the problem:

I think it also applies to assignment.

> 2. the space optimization only gave little less space.

The cost from not using EBO amounts to a few bytes - which can
sometimes be offset due to alignment. Since 4 bytes is typically
required per bucket it doesn't seem like a large amount. Early
versions used boost::compressed_pair but that had poor support for
Visual C++ 6 (which I supported at the time). I've been thinking about
reintroducing EBO, but there have also been plenty of other more
pressing tasks.

I'd probably implement it manually though, as I don't think using
compressed_pair would buy much. I can't imagine a situation where the
hash function will be empty and the equality predicate won't so there
isn't much point in the extra complexity and dependency. Similarly,
I'm not aware of an allocator that is empty for a bucket, but not for
a node.


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