Commit Graph

1204 Commits

Author SHA1 Message Date
Daniel James
b8c754d230 Set the high bit in bucket_info_ to false for first node in group
And true for the reset, so that in containers with unique keys
bucket_info_ is always just the bucket index.
2017-05-01 21:03:11 +01:00
Daniel James
338a94e577 Better rvalue emulation support in extractors
Means that inserting rvalues into unordered_set/unordered_map won't
create a node if no insert is required.
2017-05-01 21:03:11 +01:00
Daniel James
2e14c340a8 Reformat 2017-05-01 21:03:11 +01:00
Daniel James
35522d3ee0 Fix merging between containers with different hash/equality
This reverts commit 20b0c0a6d8.
2017-04-30 14:29:05 +01:00
Daniel James
8c139940e7 More merge tests between compatible containers 2017-04-30 14:29:05 +01:00
Daniel James
7b5f73f6c2 Disable all sunpro workarounds on latest version
I have no idea if they're still working. I wasn't able to run the latest
solaris in a virtual machine on my computer, so this is the only way to
test.
2017-04-30 10:44:54 +01:00
Daniel James
e7a3487df4 Remove policy template parameter from local iterators 2017-04-30 10:44:54 +01:00
Daniel James
c243895fc0 Remove odd check that should never be true
I think it was left over from the old grouped node implementation.
2017-04-30 10:44:54 +01:00
Daniel James
451d0f2fc5 Constructing nodes is nothrow, so no need to track 2017-04-30 10:43:06 +01:00
Daniel James
c75b332240 Cleaner create_buckets implementation 2017-04-30 10:43:06 +01:00
Daniel James
899248acbf Avoid shadow warning on older versions off GCC 2017-04-29 09:31:17 +01:00
Daniel James
cae6b121b2 Improve test coverage a little 2017-04-28 21:26:21 +01:00
Daniel James
5f6ee3da9c Use coveralls 2017-04-28 09:53:50 +01:00
Daniel James
bfcdd51b4a Fix try_emplace overload 2017-04-28 09:53:50 +01:00
Daniel James
10b736d407 Remove BOOST_UNORDERED_CALL_CONSTRUCT0 2017-04-28 09:53:50 +01:00
Daniel James
0b61e6defb Stop using allocators to construct/destroy internal types
The standard doesn't allow it. I should have known that.
2017-04-27 19:02:10 +01:00
Daniel James
28f529100d Merge branch 'feature/simpler-data-structure' into develop
C++17 requires that unordered_map has the same type of node as
unordered_multimap, and that unordered_set has the same type of node as
unordered_multiset. This didn't seem particularly useful to me and
contradicts the old implementation which had different nodes, I put a
lot of effort into trying to abstract out the difference and make it
selectable using a macro, so that the old implementation would still by
available for anyone who doesn't care about strict compatibility.

But I think that was a mistake, it was making things too complicated and
for too little gain. The default would still be inefficient containers
for equivalent keys, and using the macro could lead to problems down the
line.

So I've switched to using a much simpler implementation which just marks
the first node in a group of equivalent nodes. This isn't as fast when
there are a lot of elements with equivalent keys - it can't skip to the
end of a group of nodes, but at least it avoids having to do a lot of
potentially expensive comparisons.

It's also a lot closer to the intent of the standard, even if I disagree
with that intent.
2017-04-27 18:22:53 +01:00
Daniel James
6466ce0b51 Make table the same for unique and equivalent keys 2017-04-27 18:22:44 +01:00
Daniel James
03baef8b28 Remove Types::is_unique 2017-04-27 18:22:44 +01:00
Daniel James
f1435d53d4 Remove 'init' method from nodes 2017-04-27 18:22:44 +01:00
Daniel James
20b0c0a6d8 Only consider one node from each group in merge_unique 2017-04-27 18:22:44 +01:00
Daniel James
a1b1df84a0 Store bucket + whether first in group in node
Instead of the hash value.
2017-04-27 18:22:44 +01:00
Daniel James
408ebd0a0a Add node_bucket function 2017-04-27 18:22:44 +01:00
Daniel James
e9c4696544 Get rid of node_algo 2017-04-27 18:22:43 +01:00
Daniel James
ea64f2e46e Remove the grouped node stuff 2017-04-27 18:22:43 +01:00
Daniel James
94a3a9baf9 Fix some quickbook markup 2017-04-25 21:14:11 +01:00
Daniel James
da27ae4de6 Group together similar overloads of try_emplace 2017-04-25 20:20:11 +01:00
Daniel James
ed326e2c87 Expand out more preprocessor repeats 2017-04-25 20:20:11 +01:00
Daniel James
bea4c6e29b undef some macros 2017-04-25 20:20:11 +01:00
Daniel James
61df9479e5 Rename unique_node 2017-04-25 20:20:11 +01:00
Daniel James
e3ab7b5d2e Remove BOOST_UNORDERED_EMPLACE_ARGSn macros
They're not used anywhere now.
2017-04-25 20:20:11 +01:00
Daniel James
679b73098e Option to use grouped nodes everywhere
Seems to work okay, but I'm not happy with and of the options. So I'm
going to look into doing something else before the next release.
2017-04-25 09:54:28 +01:00
Daniel James
cba643fc51 Make setting max_load_ a tad more consistent 2017-04-25 09:54:28 +01:00
Daniel James
1c8edf0298 Remove early exit for empty containers 2017-04-25 09:54:28 +01:00
Daniel James
07b9a7d60e Fix incorrect try_emplace call 2017-04-25 01:39:30 +01:00
Daniel James
9c8980e6a1 Write out epoint that threw an exception after failure 2017-04-25 01:21:44 +01:00
Daniel James
60127d86e0 After 5 failures stop running an exception test 2017-04-25 01:10:53 +01:00
Daniel James
0c3c738614 Better C++ version info 2017-04-25 01:09:07 +01:00
Daniel James
c8bacbcb00 Merge branch 'feature/combine-unique-equiv-tables' into develop
Expanding a lot of the call to the implementation methods. While working
on some recent changes, I felt the call chains in error messages were
too long, this reduces that a little. It also should make debugging a
tad easier and I think it makes the methods a little more informative,
as you can see what they're doing without hunting around the
implementation file. Also reduces the number of symbols when compiling,
although I'm not sure if that will make much of a difference.

Does make the code a little long, and duplicated, but I don't think it's
particularly harmful.
2017-04-24 09:46:05 +01:00
Daniel James
b070bb5e49 Move everything from table_unique/table_equiv into table 2017-04-24 09:46:05 +01:00
Daniel James
e518120104 Rename some copy/assign/move methods
But with a hack so that the static casts will work until there's a
better method.
2017-04-24 09:46:05 +01:00
Daniel James
84f1ef6d2d Move constructor implementation into containers 2017-04-24 09:46:05 +01:00
Daniel James
77bf2b5e33 Rename methods to be different for unique/equiv keys
So that the implementation can be moved into a single class. Still some
other methods to rename. Some methods didn't need to be renamed (e.g.
try_emplace is only used with unique keys), but still renamed for
consistency.
2017-04-24 09:46:05 +01:00
Daniel James
8229aa6b3c Stop throwing exception in allocator copy/assignment
The standard specifies that all of these "shall not exit via an
exception". The containers have been exception safe when these throw,
but the 'noexcept' attribute on 'get_allocator' will terminate if an
exception is thrown in the copy constructor.

The standard doesn't specify a default constructor, so that is allowed
to throw an exception (not just pedantry, this makes sense if an
allocator has shared data that's allocated in the initial constructor).
2017-04-23 11:01:04 +01:00
Daniel James
fc08f62d6a Remove a TODO 2017-04-23 10:51:17 +01:00
Daniel James
1254520438 Merge branch 'feature/expand-calls' into develop
Expanding a lot of the call to the implementation methods. While working
on some recent changes, I felt the call chains in error messages were
too long, this reduces that a little. It also should make debugging a
tad easier and I think it makes the methods a little more informative,
as you can see what they're doing without hunting around the
implementation file. Also reduces the number of symbols when compiling,
although I'm not sure if that will make much of a difference.

Does make the code a little long, and duplicated, but I don't think it's
particularly harmful.
2017-04-23 10:46:27 +01:00
Daniel James
7941771d61 Expand calls to at implementation 2017-04-23 10:09:18 +01:00
Daniel James
4f1c6e1ebf Expand calls to init/move_init 2017-04-23 10:09:18 +01:00
Daniel James
13ff1e7fb1 Expand calls to count and equal_range implementation 2017-04-23 10:09:18 +01:00
Daniel James
25b0b66e52 Expand calls to erase implementation
Doesn't work as well as the previous changes.
2017-04-23 10:09:18 +01:00