Commit Graph

596 Commits

Author SHA1 Message Date
Daniel James
88612a8be4 Less faffing around with node_constructor. 2016-08-14 20:55:40 +01:00
Daniel James
37a6903831 Move node construction into allocate.hpp 2016-08-14 20:55:40 +01:00
Daniel James
8017d9e684 Change how node construction works.
Split node_constructor into two classes, one for constructing a node
without a value, and then another for holding it once the value is
constructed.

Do the work of constructing values in convenience functions in
allocate.hpp (construct_value_generic, construct_value, construct_pair).
2016-08-14 20:55:40 +01:00
Daniel James
609ae6cb4e Expand out fill_buckets. 2016-08-14 20:55:40 +01:00
Daniel James
7b8e3d01de Use argument SFINAE instead of return SFINAE 2016-06-03 00:00:51 +01:00
Daniel James
b4a3c6f460 Fix exception safety in assignment for multimap/multiset.
The assignment code seemed like a bit of a premature optimization, I
replaced it with a slightly slower but much simpler implementation.
2016-05-30 15:02:04 +01:00
Daniel James
3f42a56bae Remove old deprecated warning. 2016-05-26 09:25:10 +01:00
Daniel James
144a0c1791 Remove BOOST_NO_STD_DISTANCE workaround. 2016-05-26 09:24:25 +01:00
Daniel James
cc2b1a1ef1 Stop using deprecated boost::iterator. 2016-05-26 09:24:21 +01:00
Zoey Greer
3a507b4e39 Bounds-check after arithmetic is complete
double_to_size can return std::numeric_limits<size_t>max(), so we cannot add 1 to the return value of double_to_size. That addition should be done while still working with a double, as can be seen being done on line 850 of this file.
This was uncovered by Coverity, and addresses Coverity issues CID13443 and CID12664
2014-12-08 16:38:38 -05:00
Daniel James
8ccde2e5a1 Move the allocators after copying the hash functions.
Just in case the hash functions throw.
2014-11-09 23:44:16 +00:00
Daniel James
31211a607f Remove assertion that used moved allocator. Fixes #10777. 2014-11-09 23:35:35 +00:00
Adam Wulkiewicz
1d8855da27 Remove template patameters from friend declarations in interator<>. 2014-11-09 13:36:27 +01:00
Daniel James
0cedaf7ad6 Rename iterator typedef to n_iterator. 2014-11-08 22:22:11 +00:00
Daniel James
b4795f414d Remove unneeded ConstNodePointer template parameters. 2014-11-08 22:22:11 +00:00
Daniel James
a81c86a90e Remove use of operator&.
Also reactivate operator& for minimal test classes. Apparently I
disabled them because of a problem in a type trait, but I'm not seeing
that now. Maybe it will appear on other compilers.
2014-10-26 22:21:12 +00:00
Daniel James
99985bb1b2 Fix pointer types in iterators.
https://svn.boost.org/trac/boost/ticket/10672
2014-10-22 22:03:32 +01:00
Zoey Greer
8c5aa5086d Initialize data_ in value_base default constructor
This means data_ should get initialized in the default constructor for boost::unordered::detail::unique_node (and any other inheritors), as this constructor will be called there.

This uninitialized data member was reported by Coverity (CID 49445), which unfortunately does not seem to have any convenient way to publicly, globally address issues.
2014-10-22 21:27:27 +01:00
Daniel James
b1232d8061 Revert some changes so that I can merge to master.
Revert "Rename iterator typedef to n_iterator." and "Combine some of the
headers."

This reverts commits: 2f6b81d8c1 and
e1b39bbbfb.
2014-10-22 21:24:36 +01:00
Daniel James
2f6b81d8c1 Rename iterator typedef to n_iterator. 2014-08-19 16:41:10 +01:00
Daniel James
e1b39bbbfb Combine some of the headers. 2014-08-19 16:41:10 +01:00
Daniel James
2f5d98a0cd Don't use allocator to construct/destroy anything other than elements.
As specified in 23.2.1.3.
2014-07-12 19:12:46 +01:00
Daniel James
2216c987a0 Fixed direct use of allocator. 2014-07-11 09:13:47 +01:00
Daniel James
86d4d21250 Make value_base a member of pointer nodes. 2014-07-11 08:40:07 +01:00
Daniel James
99fdce0b4d Fix policy typedefs. 2014-02-24 16:54:12 +00:00
Daniel James
57819d1dd9 Always use prime policy for integers. Fixes trac #9282. 2014-02-23 10:16:14 +00:00
Daniel James
94071cc6e8 Clean up warnings. Fixes trac #9377. 2014-01-26 22:57:24 +00:00
Daniel James
239453bead Fix unordered on Sun 5.12 compiler. Refs #9424.
[SVN r86792]
2013-11-23 11:43:19 +00:00
Daniel James
ddab816ed7 Use BOOST_HAS_PRAGMA_ONCE.
Remembering to first include config, so that it'll actually be defined.

[SVN r86726]
2013-11-16 20:13:24 +00:00
Daniel James
6f3dee13a8 Extend the Visual C++ workaround to 3 parameters.
To avoid collision with piecewise construction.

[SVN r86506]
2013-10-28 20:32:52 +00:00
Daniel James
7f14796ba4 Try to work around Visual C++'s variadic overload bug.
Possibly too late for the release.

[SVN r86482]
2013-10-27 17:58:09 +00:00
Daniel James
cfb4a9d254 Revert attempted work around for Visual C++.
[SVN r86478]
2013-10-27 13:14:12 +00:00
Daniel James
621c1523c0 Fix potential msvc 12 workaround.
[SVN r86433]
2013-10-25 22:21:51 +00:00
Daniel James
b4d62e4670 Attempt to work around Visual C++ initializer list overload bug.
I'm hoping that these templated initializer lists will be considered a better
overload than the others. I have no idea if it will actually work, this is a
real shot in the dark.

The enable_if checks should probably be for implicit conversion, there might
be a chance this could override a valid call when there's an explicit
conversion.

[SVN r86419]
2013-10-24 18:11:35 +00:00
Stephen Kelly
3aa91346ea Remove obsolete MSVC check from pragma guard
git grep -h -B1 "^#\s*pragma once" | grep -v pragma | sort | uniq

is now clean.

[SVN r85952]
2013-09-26 13:02:51 +00:00
Daniel James
de0366105c Avoid Visual C++ warning.
Avoiding:

    warning C4127: conditional expression is constant

[SVN r85281]
2013-08-10 13:09:28 +00:00
Daniel James
3508ceaa58 Avoid exposing functions via ADL.
I'd put the iterators in their own namespace so that they wouldn't pick
up functions in detail via ADL, but I forgot that their template
parameters would cause that to happen anyway. The simplest way to fix
that for now is just to stuff the problematic functions into a
sub-namespace, so that they're no longer exposed.

[SVN r85280]
2013-08-10 13:09:08 +00:00
Daniel James
29660f9c4d Remove unused typedef. Refs #8874.
[SVN r85245]
2013-08-08 20:28:53 +00:00
Daniel James
52b42b4e48 Fix unused variable warning. Refs #8851.
Bit annoying that `boost::ignore_unused_variable_warning` is in
`<boost/concept_check.hpp>`.

[SVN r85244]
2013-08-08 20:27:40 +00:00
Daniel James
f8a6ea40a1 Add noexcept annotations to iterators.
I couldn't find any sepecification in the standard, but I'd assume that since
`begin` and `end` are both `noexcept`, the iterator copy constructors must be.

To justify adding `noexcept` to these members, see 17.6.3.5 (part of the
allocator requirements) of n3485, which says about allocator's pointer types,
"No constructor, comparison operator, copy operation, move operation, or swap
operation on these types shall exit via an exception."

Not relevant in this case but allocator pointers also need to model
NullablePointer. From 17.6.3.3, "No operation which is part of the
NullablePointer requirements shall exit via an exception."

[SVN r84374]
2013-05-19 15:00:40 +00:00
Daniel James
1a067034c1 Add conditional noexcept for move constructors.
Also added `noexcept` for destructors because of a gcc bug, see:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56191

Found via:

http://stackoverflow.com/questions/15721544/destructors-and-noexcept

[SVN r84373]
2013-05-19 14:30:12 +00:00
Daniel James
d603e75d03 Use nothrow move construction for function objects, when available.
[SVN r84277]
2013-05-13 23:13:04 +00:00
Daniel James
a422b40041 Use nothrow move assignment for function objects, when available.
Originally I was going to use two different versions of `hash_functions`, but
the recent discussion on binary compatibility persuaded me not to.

[SVN r84276]
2013-05-13 23:12:46 +00:00
Daniel James
44f61e5878 Add BOOST_NOEXCEPT to unordered container methods.
I haven't done the iterators yet.

[SVN r84253]
2013-05-12 14:34:45 +00:00
Daniel James
6b21eeccab Unordered: Fix move assignment with unequal allocators.
[SVN r82614]
2013-01-25 21:22:03 +00:00
Marshall Clow
85d2657ac1 Remove usage of deprecated macros
[SVN r81449]
2012-11-21 01:21:54 +00:00
Daniel James
8fb85cbb8d Unordered: Fix overload edge case for piecewise construction.
[SVN r81393]
2012-11-17 12:03:55 +00:00
Daniel James
da455124d2 Unordered: Try to make the piecewise_construct emulation a little more readable.
[SVN r81392]
2012-11-17 12:03:32 +00:00
Daniel James
ef4d33ce89 Unordered: Remove the deprecated equality implementation.
[SVN r81385]
2012-11-17 10:30:19 +00:00
Daniel James
7eefe62efe Unordered: Remove deprecated variadic pair constructors.
This was emulating them as specified in older standard drafts.

[SVN r81384]
2012-11-17 10:28:35 +00:00
Daniel James
73c0d85ae6 Unorderd: Stop deriving from hash policy.
[SVN r81209]
2012-11-05 18:33:29 +00:00
Daniel James
d495cbd7e6 Unordered: Clean up the pointer silliness.
[SVN r81208]
2012-11-05 18:33:15 +00:00
Daniel James
ccc3d1c83d Unordered: Simpler erase implementation.
[SVN r81207]
2012-11-05 18:32:59 +00:00
Daniel James
38d8d052d1 Unordered: Simplify pointer use.
[SVN r81206]
2012-11-05 18:32:45 +00:00
Daniel James
d1a6e948e3 Unordered: bcp friendly macros.
[SVN r81029]
2012-10-21 00:17:40 +00:00
Daniel James
8f8ea09ce8 Unordered: Fix bug when erasing a range, refs #7471.
[SVN r80894]
2012-10-07 08:19:01 +00:00
Daniel James
94ef1ac391 Unordered: Support empty containers in node_holder.
[SVN r80562]
2012-09-17 18:59:29 +00:00
Daniel James
53f278312f Unordered: Get rid of get_start.
[SVN r80561]
2012-09-17 18:59:03 +00:00
Daniel James
549b93e629 Unordered: delete_buckets works when buckets_ is null.
[SVN r80560]
2012-09-17 18:58:28 +00:00
Daniel James
c2e7221bf9 Unordered: Set max_load_ to 0 when there are no buckets.
[SVN r80559]
2012-09-17 18:57:58 +00:00
Daniel James
37d58e84e3 Unordered: Fix creating extra node when resizing.
[SVN r80518]
2012-09-13 19:50:31 +00:00
Daniel James
ec6219fe13 Unordered: Fix incorrect assertion.
[SVN r80508]
2012-09-12 21:09:39 +00:00
Daniel James
ed369d6374 Unordered: Move MSVC warning suppression to correct location.
[SVN r80412]
2012-09-05 19:02:29 +00:00
Daniel James
1d03bbe213 Unordered: Re-initialise reused nodes.
[SVN r80410]
2012-09-05 19:01:17 +00:00
Daniel James
32ab636fe8 Unordered: delete/destroy/clear cleanup.
[SVN r80390]
2012-09-03 20:06:00 +00:00
Daniel James
8e5ffbbe6c Unordered: Clean up swap.
[SVN r80389]
2012-09-03 20:05:39 +00:00
Daniel James
e7f495c094 Unordered: Cleaning up a bit.
[SVN r80388]
2012-09-03 20:05:15 +00:00
Daniel James
1e07edc1ad Unordered: No need for value_allocator.
[SVN r80387]
2012-09-03 20:04:55 +00:00
Daniel James
2f09079d3f Unordered: Remove the now unnecessary uses of ->.
[SVN r80386]
2012-09-03 20:04:35 +00:00
Daniel James
a1bdd82bd5 Unordered: Get rid of buckets.
[SVN r80385]
2012-09-03 20:04:15 +00:00
Daniel James
45b6340a98 Unordered: Avoid allocating nodes in table constructor.
[SVN r80384]
2012-09-03 20:03:55 +00:00
Daniel James
22e6daac6c Unordered: Use node_holder for move.
[SVN r80383]
2012-09-03 20:03:35 +00:00
Daniel James
9ea735c975 Unordered: Move iterators to top of buckets.hpp
[SVN r80382]
2012-09-03 20:03:15 +00:00
Daniel James
31f3a10d33 Unordered: Tweak node_construct functions.
[SVN r80381]
2012-09-03 20:02:53 +00:00
Daniel James
d9f49f2b44 Unordered: Faster assign implementation
[SVN r80380]
2012-09-03 20:02:31 +00:00
Daniel James
73c269398a Unordered: Generic copy/move implementation.
[SVN r80379]
2012-09-03 20:02:10 +00:00
Daniel James
7a4930f1a1 Unordered: Avoid unnecessary swapping in rehash and move.
[SVN r80378]
2012-09-03 20:01:50 +00:00
Daniel James
f8968ab022 Unordered: Better swap assertion.
[SVN r80224]
2012-08-25 21:54:18 +00:00
Daniel James
8f86c2464e Unordered: Rename *_impl to *_value_impl.
To make it clear that they should only be used to construct and destroy
the value, and not nodes or buckets.

[SVN r80223]
2012-08-25 21:53:53 +00:00
Daniel James
cd57bf5000 Unordered: And use allocator traits to destroy values.
[SVN r80222]
2012-08-25 21:53:25 +00:00
Daniel James
a7125259d8 Unordered: When full construct is available, use it for value.
[SVN r80221]
2012-08-25 21:52:57 +00:00
Daniel James
3a163b5449 Unordered: Move some things around.
- Move `allocator_traits` before `construct_impl` so the
  `construct_impl` can be changed to use `allocator_traits`.
- Moved some move utilities out of `allocate.hpp` because they're
  really nothing to do with allocation and construction.

[SVN r80220]
2012-08-25 21:52:28 +00:00
Daniel James
ff31c73970 Unordered: Go back to the old method for constructing nodes.
Reverts much of [78349]. Keeps the variadic construct.

[SVN r80219]
2012-08-25 21:51:24 +00:00
Daniel James
27f5496a65 Unordered: Fix some uses of rvalues refs/move.
[SVN r79792]
2012-07-29 07:17:57 +00:00
Daniel James
918b3da91d Unordered: Use a SFINAE parameter rather than return type for C++03 compilers.
Seems that g++ 3.4 has problems with overloads that are only distinguished by
SFINAE return types.

[SVN r79762]
2012-07-26 22:23:09 +00:00
Daniel James
61516be1db Unordered: Remove use of try..catch.
So that it'll work when exceptions are disabled.

[SVN r79679]
2012-07-22 20:14:20 +00:00
Marshall Clow
0fccd93e29 Switch from deprecated macros to new shiny ones; no functionality change
[SVN r79396]
2012-07-09 22:08:01 +00:00
Daniel James
6932a2d571 Unordered: Fix using a C++03 allocator with C++11 compiler.
Because the nodes had an implicit constructor, the `has_construct` traits was
detecting that the nodes could be constructed by construction then copy, which
really wasn't wanted. Also add a check that nodes aren't been copy constructed
to make sure this doesn't happen again. Refs #7100.

[SVN r79358]
2012-07-08 11:55:57 +00:00
Daniel James
b8d96be8f7 Unordered: Macro to simplifiy variadic/emplace_args creation.
[SVN r79351]
2012-07-08 11:53:16 +00:00
Daniel James
68edec9f97 Unordered: Remove old, unused function.
[SVN r79350]
2012-07-08 11:52:38 +00:00
Daniel James
39bafd7b10 Unordered: Reapply changes reverted in r78788.
[SVN r79163]
2012-06-28 20:58:56 +00:00
Daniel James
893ebc5adb Unordered: Don't use std::allocator_traits on Visual C++ 11.
[SVN r78789]
2012-06-01 11:06:03 +00:00
Daniel James
7158700502 Unordered: Revert unmerged changes in trunk.
So that I can fix issues in the beta.


[SVN r78788]
2012-06-01 11:03:22 +00:00
Daniel James
1eac47a275 Unordered: Use Boost.Move in a few more places.
Should be better for compilers with variadic parameters, but no rvalue
references. If such a thing ever exists.

[SVN r78536]
2012-05-21 22:15:33 +00:00
Daniel James
c6f0175c79 Unordered: Combine emplace_args + allocator_helpers.
[SVN r78535]
2012-05-21 22:14:59 +00:00
Daniel James
6031b66f99 Unordered: Fix namespaces for renaming in bcp. Refs #6905.
[SVN r78491]
2012-05-17 06:20:55 +00:00
Daniel James
d863f17673 Unordered: Try to fix Sun compile error.
The Sun compile tests have started failing, I'm not sure what triggered this,
but it seems to be confused by the various uses of the identifier `node`, so
try renaming the class and see if that improves things.

[SVN r78413]
2012-05-10 21:37:44 +00:00
Daniel James
24c08646f4 Unordered: Fix macros for picking construct/destroy.
[SVN r78378]
2012-05-08 11:02:29 +00:00
Daniel James
6604abe600 Unordered: allocator_helpers cleanup.
[SVN r78370]
2012-05-07 18:10:27 +00:00
Daniel James
39aed02e32 Unordered: Check that reserve works for both range and single element insert.
[SVN r78369]
2012-05-07 18:10:04 +00:00
Daniel James
6b44f3b887 Unordered: Fix destroy to match construct in last commit.
[SVN r78368]
2012-05-07 18:09:25 +00:00
Daniel James
cd88cb4a30 Unordered: 'full construct' requires SFINAE expressions.
[SVN r78367]
2012-05-07 12:22:24 +00:00
Daniel James
32dc45b7bd Unordered: Implement reserve. Refs #6857.
[SVN r78365]
2012-05-07 10:58:32 +00:00
Daniel James
275b03e76b Unordered: Avoid -Wshadow warnings. Refs #6190.
[SVN r78364]
2012-05-07 10:57:35 +00:00
Daniel James
995ef1efdb Unordered: Use std::allocator_trait's variadic construct.
[SVN r78349]
2012-05-06 12:29:24 +00:00
Daniel James
8cb85937c4 Unordered: Reactivate std::allocator_traits for gcc 4.7, and try for Visual C++ 11
[SVN r78348]
2012-05-06 12:28:57 +00:00
Daniel James
e615ac67c2 Unordered: allocator_helpers.hpp was moved.
[SVN r78347]
2012-05-06 12:28:05 +00:00
Daniel James
531f6804ad Unordered: Disable std::allocator_traits on gcc for now.
[SVN r78166]
2012-04-23 20:52:08 +00:00
Daniel James
d5230a874b Unordered: Rejig some of the emplace_args macro code. Refs #6784
This is a bit cleaner and will hopefully fix the Sun problems.

[SVN r77972]
2012-04-14 17:32:28 +00:00
Daniel James
030fd55d02 Unordered: Pull forward declarations out of detail/fwd.hpp
[SVN r77835]
2012-04-08 15:30:35 +00:00
Daniel James
626bb48013 Unordered: Use iterators in more of the implementation methods.
[SVN r77834]
2012-04-08 15:30:14 +00:00
Daniel James
e64f82ed03 Unordered: Fix equality for multimap/multiset.
[SVN r77833]
2012-04-08 15:29:49 +00:00
Daniel James
c8c71d0ad1 Unordered/hash: Avoid a gcc warning. Refs #6771
[SVN r77832]
2012-04-08 15:29:15 +00:00
Daniel James
4e759b4444 Unordered: Call policy functions as static functions.
[SVN r77831]
2012-04-08 15:28:26 +00:00
Daniel James
2fed2fbd9e Unordered: Hashing policy for 64 bit computers.
[SVN r77066]
2012-02-18 15:47:59 +00:00
Daniel James
8a1a475c58 Unordered: Use container's allocator_traits for old Visual C++.
[SVN r77017]
2012-02-14 23:55:09 +00:00
Daniel James
08230efb44 Unordered: Use C++11 allocator_traits with gcc 4.7.
[SVN r76970]
2012-02-11 12:33:25 +00:00
Daniel James
2aee3add16 Unordered: Remove some of the smaller primes.
There's quite a high chance of collisions for these values.

[SVN r76969]
2012-02-11 12:33:02 +00:00
Daniel James
992cc0b077 Unordered: Some C++11 allocator_traits fixes.
Can now be used with g++ 4.7. Not activating by default yet.

[SVN r76893]
2012-02-05 08:45:52 +00:00
Daniel James
2e80a82554 Unordered: Fix undefined macro warnings. Refs #6522.
Just removing the rv reference stuff in extract_keys. I don't it's
needed anyway.

[SVN r76891]
2012-02-05 08:44:22 +00:00
Daniel James
2665090568 Unordered: Use Boost.Move for variadic forwarding.
[SVN r76331]
2012-01-06 08:36:43 +00:00
Daniel James
d70fcb8c25 Unordered: Make using Boost.Move optional.
[SVN r76330]
2012-01-06 08:35:51 +00:00
Daniel James
8f982c8b27 Unordered: Fix forwarding from emplace.
[SVN r75856]
2011-12-07 19:18:11 +00:00
Daniel James
a61e876300 Unordered: emplace cleanup.
- Always construct iterator in detail for consistency.
- Move 0-argument emplace to start of overloads.

[SVN r75744]
2011-11-30 08:21:58 +00:00
Daniel James
684e40464f Unordered: Manually write out some overloads for emplace.
Clang creates horrific error messages for Boost.Preprocessor based code,
so for small number of arguments manually write out a few important
functions. Not doing this everywhere.

[SVN r75743]
2011-11-30 08:21:38 +00:00
Daniel James
2507fd78e3 Unordered: Move rebind into 'types' classes.
Makes the types in error messages a tad bit nicer.

[SVN r75742]
2011-11-30 08:21:04 +00:00
Daniel James
aeea8e05ad Unordered: Fix gcc warning and re-enable warnings-as-errors for gcc.
[SVN r75599]
2011-11-21 23:21:11 +00:00
Daniel James
11c9955902 Unordered: Remove support for TR1 tuples. Refs #6111.
[SVN r75432]
2011-11-10 15:16:06 +00:00
Daniel James
9cb361f35e Unordered: construct_from_tuple for old versions of sun.
Not properly tested, as I haven't got the compiler fully working on my
machine.

[SVN r75341]
2011-11-06 09:34:54 +00:00
Daniel James
c3477b2624 Unordered: Don't use SFINAE expression hack on Visual C++.
Sometimes it doesn't work. This means I can clean up the implementation
for other compilers, but I'll leave that for now.


[SVN r75167]
2011-10-29 16:31:40 +00:00
Daniel James
a5dcc9dab0 Unordered: Return iterators in pairs instead of node_pointers.
It looks like the current version doesn't work with a correct
implementation of C++11 pairs since they don't use explicit conversions.
So just return the correct type in the first place.

Should probably be using iterators in other places as well. I was using
node_pointers everywhere due to some legacy from older versions.

[SVN r75158]
2011-10-28 17:42:51 +00:00
Daniel James
6ebc2e72ff Unordered: Rename B0, B1 etc. to avoid macro clash. Refs #6062.
[SVN r75123]
2011-10-26 21:31:27 +00:00
Daniel James
4471e056f4 Unordered: Avoid passing UDTs through ....
[SVN r74913]
2011-10-11 08:36:23 +00:00
Daniel James
b56a5ead66 Unordered: Some inspect fixes.
[SVN r74908]
2011-10-11 00:31:19 +00:00
Daniel James
2775ae2f2e Unordered: Correct fix for old gcc.
[SVN r74836]
2011-10-09 01:23:25 +00:00
Daniel James
8557a30592 Unordered: Fix dependent type.
[SVN r74832]
2011-10-09 00:47:08 +00:00
Daniel James
fd530b87f6 Unordered: Remove use of BOOST_PP_ENUM_SHIFTED.
Doesn't seem to work on Intel's preprocessor.

[SVN r74813]
2011-10-08 17:39:54 +00:00
Daniel James
674d635024 Unordered: Move has_member into nested struct for sun.
[SVN r74812]
2011-10-08 17:39:36 +00:00
Daniel James
f304e56818 Unordered: Stop using void_pointer.
Was breaking for allocators that don't have good enough support for
void_pointer. Which I suspect is pretty common.

[SVN r74800]
2011-10-08 12:17:27 +00:00
Daniel James
5a2bf64a65 Unordered: Just do member detection on older compilers.
[SVN r74799]
2011-10-08 12:17:09 +00:00
Daniel James
f1b78931d1 Unordered: More misc. cleanup.
Including removing node.hpp.

[SVN r74775]
2011-10-07 08:19:53 +00:00
Daniel James
3d7b6c64b5 Unordered: some more formatting + namespaces
[SVN r74767]
2011-10-06 21:31:25 +00:00
Daniel James
597d93537d Unordered: More cleaning up.
Fix deprecated construct_impl and explicit namespaces in a few places.

[SVN r74766]
2011-10-06 21:06:35 +00:00
Daniel James
3a909c8747 Unordered: Better emplace_args implementation.
And some misc. cleanup.

[SVN r74750]
2011-10-06 08:03:25 +00:00
Daniel James
ad38ecf6d8 Unordered: Remove some std::cout debugging. Oops.
[SVN r74746]
2011-10-05 22:05:52 +00:00
Daniel James
dac1dc5837 Unordered: Reorganization to use void pointers and other things.
Helps allocators which can't use incomplete pointers, and avoid using
base pointers where that might not be possible.  And some other
reorganization. Storing arguments to emplace in a structure when
variadic template parameters aren't available. Changed some of the odd
design for working with older compilers.

[SVN r74742]
2011-10-05 19:45:14 +00:00
Daniel James
c0aaf908c0 Unordered: Tweak member detection for sun.
Detect using a member pointer, rather than a member function pointer.
Sun seems to be happier with that.

[SVN r74605]
2011-09-28 23:50:27 +00:00
Daniel James
b1d782285c Unordered: Remove void cast.
I don't think it's needed.

[SVN r74542]
2011-09-23 20:27:39 +00:00
Daniel James
b0620a46ff Unordered: Don't use BOOST_UNORDERED_HAS_FUNCTION with Sun.
Something is causing the sun compiler to crash. I don't know if it's the
member detection or testing if the member if callable, so try disabling
the callable test to see if that works better.

[SVN r74541]
2011-09-23 20:27:22 +00:00
Daniel James
340c98d89a Unordered: New member function detection.
Based on Ion's `has_member_function_callable_with`.

[SVN r74532]
2011-09-22 23:56:49 +00:00
Daniel James
f8abb9633a Unordered: Revert [74315].
I checked it in due to some clumsy rebasing.


[SVN r74326]
2011-09-09 10:42:56 +00:00
Daniel James
7d441864ec Unordered: Remove use of allocator utilities.
[SVN r74317]
2011-09-08 21:10:39 +00:00
Daniel James
8ecdee5a93 Unordered: Try to fix vacpp's issue with select_on_container_copy_construction
[SVN r74315]
2011-09-08 21:09:56 +00:00
Daniel James
70c39ad5ea Unordered: Revert [74236].
On vacpp `has_select_on_container_copy_construction` was incorrectly returning
positive for a non-const `select_on_container_copy_construction`. This resulted
in a compile error as it tried to call it for a const allocator. The workaround
seemed to have just made things worse so I'm reverting it. It's actually not
that bad a problem as a non-const `select_on_container_copy_construction` is
probably a mistake.


[SVN r74294]
2011-09-07 10:01:25 +00:00
Daniel James
96fc0fa3c2 Unordered: Try to fix vacpp's issue with select_on_container_copy_construction
[SVN r74236]
2011-09-05 08:06:17 +00:00
Daniel James
c101aec06c Unordered: Use destroy workaround for allocator_traits.
[SVN r74235]
2011-09-04 19:49:11 +00:00
Daniel James
bd79d02049 Unordered: Remove unreachable code.
[SVN r74218]
2011-09-04 11:58:56 +00:00
Daniel James
965e25c989 Unordered: Try to fix issues with moving non-class types.
[SVN r74193]
2011-09-02 08:28:52 +00:00
Daniel James
a3ffd4a7c9 Unordered: Remove BOOST_DEDUCED_TYPENAME
[SVN r74192]
2011-09-02 08:28:19 +00:00
Daniel James
41b9b8d841 Unordered: Remove pair cast.
[SVN r74191]
2011-09-02 08:27:27 +00:00
Daniel James
26a47d33c1 Unordered: Use return type SFINAE, seems to be more portable.
[SVN r74182]
2011-09-01 08:26:36 +00:00
Daniel James
1154b5729a Unordered: Deprecate variadic pair construction emulation.
[SVN r74181]
2011-08-31 22:57:57 +00:00
Daniel James
fd1aec2998 Unordered: Add option to use old equality implementation for backwards compatability.
[SVN r74180]
2011-08-31 22:23:01 +00:00
Daniel James
659b6fe8ba Unordered: Another attempt at member detection.
Another stab in the dark. Doing SFINAE in the return type appears to
work well, apart for Visual C++ 8.0. Will have to see how the test
results go for some compilers.

[SVN r74173]
2011-08-30 22:02:27 +00:00
Daniel James
ceef4d6521 Unordered: Explicitly pick construct_impl overloads.
Still getting ambiguous call errors for some older compilers, so use SFINAE to
only enable a single overload for each arity.

[SVN r74171]
2011-08-30 22:01:54 +00:00
Daniel James
395c744d6f Unordered: More portability changes.
[SVN r74122]
2011-08-29 11:10:09 +00:00
Daniel James
155077cba0 Unordered: Support piecewise pair construction.
Will need to deprecate the old variadic style pair construction, also
should look into extract_key, was written for compatibility with older
compilers that are no longer supported.

[SVN r74119]
2011-08-29 09:40:41 +00:00
Daniel James
4bf3b1bfc5 Unordered: Support optional allocator methods.
Only for compilers with SFINAE expressions and recent versions of Visual
C++. Also fix Visual C++ 8, and use BOOST_UNORDERED_ prefix for all
macros.

[SVN r74106]
2011-08-28 15:36:58 +00:00
Daniel James
6bc99ac0c2 Unordered: Hopefully vacpp will like this more.
[SVN r74103]
2011-08-28 11:31:43 +00:00
Daniel James
09e856562a Unordered: Try to avoid warning on sun.
[SVN r74102]
2011-08-28 11:31:23 +00:00
Daniel James
5dd13dbfb3 Unordered: Try to avoid std::size_t to double warnings.
Maybe I should use long double?

[SVN r74087]
2011-08-27 11:53:48 +00:00
Daniel James
9ae19a64d7 Unordered: Fix more calls to std::forward.
[SVN r74086]
2011-08-27 11:29:04 +00:00
Daniel James
bd13f2b1ad Unordered: Fix some calls to std::forward.
[SVN r74074]
2011-08-26 15:28:56 +00:00
Daniel James
3f4d031c43 Unordered: Remove extra ';'.
[SVN r74072]
2011-08-26 15:24:16 +00:00
Daniel James
674b39243f Unordered: More robust construct_impl.
[SVN r74068]
2011-08-26 08:12:08 +00:00
Daniel James
099a893678 Unordered: More portable allocator_traits.
[SVN r74067]
2011-08-26 08:11:46 +00:00
Daniel James
e295541dae Unordered: Try to make VC++ 8 happy.
[SVN r73973]
2011-08-20 23:34:59 +00:00
Daniel James
785a6def3b Unordered: Remove another use of BOOST_RV_REF for sun.
[SVN r73972]
2011-08-20 23:34:38 +00:00
Daniel James
2ecfa0e08c Unordered: Fix unnecessary_copy_tests failures.
[SVN r73894]
2011-08-18 19:29:02 +00:00
Daniel James
c001139465 Unordered: detab
[SVN r73893]
2011-08-18 19:28:41 +00:00
Daniel James
e3353a445a Unordered: Fix some test failures.
[SVN r73856]
2011-08-17 21:29:41 +00:00
Daniel James
ce779452ba Unordered: Fix gcc error + warning.
[SVN r73839]
2011-08-17 07:43:43 +00:00
Daniel James
08bca9a35f Unordered: Support moving allocators.
[SVN r73805]
2011-08-15 21:34:01 +00:00
Daniel James
1db630d5c9 Unordered: Enable the better select_on_container_copy_construction detection for recent Visual C++.
[SVN r73799]
2011-08-15 20:24:12 +00:00
Daniel James
f64cf03e1d Unordered: Implement select_on_container_copy_construction support.
[SVN r73772]
2011-08-15 07:48:53 +00:00
Daniel James
559122f67a Unordered: Small improvements for windows.
[SVN r73760]
2011-08-14 21:03:18 +00:00
Daniel James
431f2abfee Unordered: Alternative member detection.
Hopefully the Sun compiler will like this.

[SVN r73757]
2011-08-14 18:53:50 +00:00
Daniel James
5f622027cd Unordered: Implement allocator propagation on assignment.
It's pretty messy because I'm trying to avoid swapping allocators in
these cases. I'm also not sure of the exception requirements of
allocator swap and assignment.

[SVN r73756]
2011-08-14 18:53:29 +00:00
Daniel James
fa97494cc8 Unordered: Move some of the unordered implementation.
[SVN r73755]
2011-08-14 18:53:03 +00:00
Daniel James
f030480e44 Unordered: detab.
[SVN r73753]
2011-08-14 18:52:20 +00:00
Daniel James
435c21c155 Unordered: Qualify calls to addressof.
Hopefully this will fix C++0x compilers. Although I don't have one at
hand to test.

[SVN r73690]
2011-08-12 06:26:25 +00:00
Daniel James
7438d7a02f Unordered: Move around assignment stuff.
[SVN r73681]
2011-08-11 21:19:05 +00:00
Daniel James
0e5930b8dc Unordred: Implement propagate_on_container_swap.
[SVN r73680]
2011-08-11 21:18:43 +00:00
Daniel James
eacca89d4e Unordered: Starting to implement allocator propagation.
[SVN r73679]
2011-08-11 21:18:19 +00:00
Daniel James
99e6bef4ef Unordered: Starting to support allocator_traits.
[SVN r73678]
2011-08-11 21:17:57 +00:00
Daniel James
3d5314b5f5 Unordered: Don't use BOOST_RV_REF with Sun compilers.
[SVN r73593]
2011-08-07 10:22:41 +00:00
Daniel James
f0517463a5 Unordered: Better std::forward/move configuration.
[SVN r73592]
2011-08-07 08:55:28 +00:00
Daniel James
d86a4b0c2f Unordered: Use Boost.Move for emplace and insert.
[SVN r73520]
2011-08-03 23:52:37 +00:00
Daniel James
eced4266c2 Unordered: Copy and assign using Boost.Move.
[SVN r73503]
2011-08-03 08:34:33 +00:00
Daniel James
b4e1d32e85 Unordered: detab.
[SVN r72906]
2011-07-04 21:55:40 +00:00
Daniel James
ff66f79721 Unordered: Import functions into boost namespace.
[SVN r72905]
2011-07-04 21:52:17 +00:00
Daniel James
8b610a6d34 Unordered: Work around for compilers which don't support template friend members.
[SVN r72523]
2011-06-09 19:48:34 +00:00
Daniel James
20e923ba0d Unordered: Move the implementation into a namespace.
Although it typically won't prevent ADL, because of boost::hash.

[SVN r72391]
2011-06-04 16:17:07 +00:00
Daniel James
4777eaf367 Unordered: remove some dead, bad code.
[SVN r72390]
2011-06-04 16:15:27 +00:00
Daniel James
a40422fada Unordered: remove use of the 'or' keyword.
[SVN r71602]
2011-04-29 11:03:29 +00:00
Daniel James
b1912055a9 Unordered: Fix some errors in the equality tests.
[SVN r71363]
2011-04-17 21:27:38 +00:00
Daniel James
e8714d79b2 Unordered: Implement C++0x equality.
[SVN r71354]
2011-04-17 16:23:25 +00:00
Daniel James
f8e2a917f9 Unordered: 2 phase lookup fix for clang.
[SVN r71352]
2011-04-17 14:27:08 +00:00
Daniel James
140e8852e8 Unordered: fix some gcc issues.
[SVN r71346]
2011-04-17 00:31:35 +00:00
Daniel James
547e141166 Unordered: Overhaul the implementation.
Store nodes in a single linked list, with hash values so that their
buckets can be found when needed. Iterators now only have to store a
pointer to the node and don't have to iterate over empty buckets to
reach the next node. This allows the container to meet the iterator
requirements - fixing the speed issues with `equal_range` and `erase`.

Also, define iterators in their own namespace, so that they don't
accidentally pull in detail functions via ADL.

I've simplified the code slightly by removing some of the special
cases for empty containers. Renamed a few things as well and other
minor changes that were made as I went along.

[SVN r71327]
2011-04-16 18:47:33 +00:00
Daniel James
a33949a0a5 Add copy constructors and assignment operators when using rvalue references. Refs #5119.
[SVN r68445]
2011-01-25 20:13:43 +00:00
Daniel James
b9188caf7d Fix [66556] - Remove clang workaround.
I accidentaly removed the good code and left the workaround in. Also, a
correction to the comment: I think bug was only in a unreleased version
of clang.

[SVN r66567]
2010-11-14 11:43:49 +00:00
Daniel James
14e0e1afc2 Less use of the ampersand operator in unordered.
[SVN r66557]
2010-11-13 12:31:54 +00:00
Daniel James
2c1a8894cb Remove clang workaround.
Clang from llvm 2.8 doesn't need it. Clang form llvm 2.7 isn't
supported.

[SVN r66556]
2010-11-13 12:30:45 +00:00
Daniel James
a49c76c69c More comments describing the unordered internals.
And fix a couple of small mistakes in the existing comments.

[SVN r66555]
2010-11-13 12:30:06 +00:00
Daniel James
77bd36d038 Declare inline functions as inline.
[SVN r66193]
2010-10-25 21:59:52 +00:00
Daniel James
daad24388c Fix iterator insert bug in unordered_set/unordered_map.
[SVN r66136]
2010-10-21 20:23:37 +00:00
Daniel James
5edc45349f Revert changes for sun 5.9.
Nobody seems to be running the tests now.


[SVN r62117]
2010-05-21 07:06:33 +00:00
Daniel James
dfaa61b666 Another inline.
[SVN r61872]
2010-05-09 07:24:47 +00:00
Daniel James
076e195cac Define several methods inline.
Sun 5.9 was having some issues.

[SVN r61831]
2010-05-06 20:13:25 +00:00
Daniel James
71a8e56ae3 Move equivalent and unique hash tables into their own headers.
[SVN r61830]
2010-05-06 20:12:40 +00:00
Daniel James
ef79fea0b7 The clang workaround broke some compilers, so only use it for clang.
[SVN r61529]
2010-04-24 12:59:35 +00:00
Daniel James
5bab4d4360 Work around friend bug in clang.
[SVN r61504]
2010-04-23 07:25:53 +00:00
Daniel James
00cebc3dfb Use boost::throw_exception in unordered.
[SVN r60983]
2010-03-31 21:42:08 +00:00
Daniel James
ee034e23bb Add quick_erase to the unordered containers. Refs #3966.
[SVN r60754]
2010-03-22 00:42:07 +00:00
Daniel James
06f63fdc0d Stop using the deprecated BOOST_HAS_ macros in unordered and hash.
[SVN r59697]
2010-02-15 23:01:06 +00:00
Daniel James
7efcf9ccff Set length of primes inside template on Sun C++. Refs #3854
[SVN r59200]
2010-01-21 18:01:53 +00:00
Daniel James
71096f4d26 Formatting changes, mostly to fit within 80 characters.
Also, some C casts converted to static_cast.

[SVN r58692]
2010-01-04 22:49:39 +00:00
Daniel James
b99382b551 Add templated find overload for compatible keys.
[SVN r58405]
2009-12-15 22:53:33 +00:00
Daniel James
4e6292b439 Implement an alternative erase function that doesn't return an iterator.
Ref #3693

[SVN r58403]
2009-12-15 22:52:52 +00:00
Daniel James
2f0a94bcfd Add missing std:: qualifier to ptrdiff_t. Refs #3773.
[SVN r58402]
2009-12-15 22:42:04 +00:00
Daniel James
c8b893cb77 Workaround codegear ICE.
It seems that the problem is calling sizeof on a dependent type when the
containers have only been used by reference. So by putting in these
dummy structures with the containers as members, it helps the compiler
instantiate the class to the level where sizeof works. I hope.

[SVN r58130]
2009-12-04 00:51:50 +00:00
Daniel James
a1252fcc0e Use consistent names for template parameters.
I'm trying to fix the codegear ICEs, but it's hard to tell the cause.
Since the error happens operator== I suspect it's either to do
with defining friend functions with different template names or
something to do with friend functions in general. This is the first stab
in the dark at fixing this.

[SVN r58062]
2009-11-30 18:25:26 +00:00
Daniel James
3e638049ec Try to support incomplete types for Sun - at the expense of zero argument emplace.
[SVN r58002]
2009-11-28 11:46:05 +00:00
Daniel James
1f17294cd3 Use remove_const again.
[SVN r57840]
2009-11-21 20:37:50 +00:00
Daniel James
df72c4886f Support incomplete template parameters to unordered containers.
[SVN r57798]
2009-11-20 08:03:26 +00:00
Daniel James
26c72f9860 Use 'E' for key extractor, freeing 'K' for key.
[SVN r57797]
2009-11-20 08:02:48 +00:00
Daniel James
55957bbab5 Some more warning fixes for Visual C++ 7.1
[SVN r57719]
2009-11-16 23:56:37 +00:00
Daniel James
ab843eb587 Fix a warning on Visual C++ 7.1. Although, I don't think I'm going to be warning free on the compiler.
[SVN r57617]
2009-11-12 21:36:27 +00:00
Daniel James
4438b8e017 Fix a warning that only shows up in release builds.
[SVN r57556]
2009-11-10 20:07:50 +00:00
Daniel James
b4f08db391 Remove 'grouped' from hash_table as it isn't used and is a bit confusing.
[SVN r57153]
2009-10-25 10:55:27 +00:00
Daniel James
060acb3f25 Slightly rearrange the unordered container headers so that prev_prime is defined before it's used.
[SVN r57152]
2009-10-25 10:55:08 +00:00
Daniel James
6bac25221a Fix unordered for intel strict.
[SVN r57139]
2009-10-24 17:53:03 +00:00
Daniel James
2fdd33381c Fix allocator for construct from initializer list.
[SVN r57006]
2009-10-19 19:32:09 +00:00
Daniel James
8d4b503e56 Use normal emplace implementation for emplace_hint and insert with hint.
There's a bug in the emplace_hint implementation for unordered
containers with equivalent keys. Since my tests missed it, I'm just
going to use the normal emplace implementation until I write better
tests.

[SVN r57005]
2009-10-19 19:24:33 +00:00
Daniel James
854dc0b353 Various inspect fixes.
[SVN r56603]
2009-10-05 21:29:39 +00:00
Daniel James
373791d0b2 Detab.
[SVN r56571]
2009-10-04 10:37:56 +00:00
Daniel James
fe3d612fe0 Clean up some unordered TODOs.
[SVN r56570]
2009-10-04 10:37:36 +00:00
Daniel James
ae0c97a77a Make sure inserting from a range of types other than the value type is better tested.
[SVN r56562]
2009-10-03 16:42:20 +00:00
Daniel James
1e24f85fbc Insert using initializer lists.
[SVN r56560]
2009-10-03 16:41:32 +00:00