<div style="font-family: arial, helvetica, sans-serif"><font size="2">And here we are!<div><br></div><div>Functional highlights:</div><div><br></div><div>- Inline buffer will have proper alignment and size constraints, with no aliasing issues AFAICT.</div>
<div>- Inline buffer re-uses the space typically occupied by the buffer pointer and buffer size, allowing for example SmallDenseMap<unsigned, unsigned, 2> to be the same size as DenseMap<unsigned, unsigned>.</div>
<div>- Supports any types DenseMap supports, including those with non-trivial constructors, destructors, copy constructors, etc.</div><div>- Significant attempts to minimize copying, but there is more to do here (see below).</div>
<div>- Tests are automatically extended to cover the new implementation.</div><div><br></div><div>All that said, this patch is still quite rough I'm afraid. There is quite a bit of duplicated and/or fiddly code that I would like to pull out. It also needs lots of commenting.</div>
<div><br></div><div>It is surprisingly hard to implement the semantics of a hash-based map with the small-buffer optimization. This works, but it is far from clean. I hope it's still acceptable, as I suspect it is worth it in many situations.</div>
<div><br></div><div>I can either try to hack on this patch until it's a bit cleaner and then submit, or I can submit, and then clean it up incrementally as I go. I only have a mild preference for the latter approach.</div>
<div><br></div><div>I *think* I have all of the construction / destruction semantics correct, and I have most of the move semantics correct but not all of them. Hardening this and adding some tests that exercise at least correct invocation of constructors and destructors will be important follow-ups to this.</div>
<div><br></div><div>Anyways, comments welcome!</div></font></div>