Commit Graph

596 Commits

Author SHA1 Message Date
Daniel James
5f5f8ef1e4 Implement try_emplace 2017-02-27 03:59:02 +00:00
Daniel James
958d206bb6 Implement insert_or_assign. 2017-02-27 03:59:02 +00:00
Daniel James
8fa93cc55b Update some comments for recent versions of standard 2017-02-23 20:14:27 +00:00
Daniel James
79cf0c4bfb pair_traits for getting pair types without instantiating.
I was having some problems in an abandoned prototype with incomplete
types, I'm not sure I will have this problem now, but I'm keeping this
anyway, as it seems useful.
2017-02-23 20:14:27 +00:00
Daniel James
81aefde94e Use const_key_type internally 2017-02-23 20:14:27 +00:00
Daniel James
96602df8a8 Remove const volatile when picking bucket policy
Could possibly do this in a more portable manner by using some sort of
function overload.
2017-02-23 20:14:27 +00:00
Daniel James
c0b72d97b3 Stricter about rebinding the allocator 2017-02-23 20:14:27 +00:00
Daniel James
ddee1b686a Move config and declaration to the start of implementataion.hpp 2017-02-23 20:14:26 +00:00
Daniel James
2231586033 Remove duplicate includes 2017-02-23 20:14:26 +00:00
Daniel James
bf5ef9824d Reformat with clang-format 2017-02-19 13:05:17 +00:00
Daniel James
f2af10c746 Protect preprocess sequence from clang format 2017-02-19 13:05:17 +00:00
Daniel James
67ab88b064 Combine most of the detail headers into a single header 2017-02-19 13:05:17 +00:00
Daniel James
67f1f65174 Linearise the detail includes
The current organisation of the headers has been making less and less
sense over the years, so to simplify things, I'm just going to combine
them into a single header. This change will make it easier to do that.
2017-02-19 13:05:17 +00:00
Daniel James
57cc6d4bac Fix exception safety when constructing pairs 2017-01-01 18:35:50 +00:00
Daniel James
33f701dd09 Fix assigning hash/key equality functions for empty containers 2016-11-21 10:24:51 +00:00
Daniel James
a7546e298e Support 10 arguments in emplace_args
Which was the intent, but only supported up to 9 arguments. I doubt
this will make much of a difference.
2016-11-02 07:30:41 +00:00
Daniel James
98cce956f9 Try to fix a 64-bit powerpc g++ 7 warning
Warning is:

allocate.hpp:335:19: warning: conversion to ???unsigned int??? from
???long unsigned int??? may alter its value [-Wconversion]

I'm not sure, but I think it's because the sizeof is a long unsigned
int, and the template parameter is an unsigned int. The sizeof isn't
even used, it's just there to get a value for expression SFINAE.
2016-10-28 09:06:53 +01:00
Daniel James
e3f534a148 Allocator aware constructors 2016-10-23 13:33:25 +01:00
Daniel James
1bcd5b0003 Make no argument constructor implicit 2016-10-23 13:32:52 +01:00
Daniel James
0d1cfba823 Rename functions in allocate.hpp 2016-10-22 10:28:53 +01:00
Daniel James
e986b70981 Stricter iterator types 2016-10-22 10:04:36 +01:00
Daniel James
9b7b485c33 Use node_pointer in equality. 2016-10-22 10:04:36 +01:00
Daniel James
c680fa7418 Remove find_matching_node.
FWIW the standard says that equality is undefined behaviour if the Hash
and Pred function objects behave differently. But I think we should
support different hash functions, e.g. so that randomized hash functions
will work.
2016-10-22 10:04:36 +01:00
Daniel James
9772c01161 Replace several uses of iterators with node pointers.
Which is to some extent going in circles, as this is how the containers
were originally implemented. But I think this is cleaner. It also fixes
a minor problem where the internal and external iterator types are
different for some containers, as the external iterators are all const.
2016-10-22 10:04:36 +01:00
Daniel James
ad2256b13c Add const cast for piecewise construction 2016-10-22 09:42:56 +01:00
Daniel James
dad0d48c9c Support containers with const value type
Currently just storing the value without a const. Can do better with
C++11 constructors, so maybe should do that, and cast away const on
compilers without support.

Another problem is that std::allocator<const int> doesn't compile for
libstdc++ (and potentially other standard libraries), so
boost::unordered_set<const int> can't compile. I'm not sure if I should
work around that, as it means changing the type of the container
(i.e. to boost::unordered_set<const int,... , std::allocator<int>>).
2016-10-17 08:06:19 +01:00
Daniel James
e03a8732a6 Use static_cast for allocator_traits::construct
std::allocator::construct uses a C-style cast to void pointer, so it can
accept const pointers, but allocator_traits::construct uses a static_cast
by default, so const pointers don't work. This means the implementation
needs to cast away const when constructing members of a std::pair. This
wouldn't happen if piecewise construction was used, as the members could
be constructed normally.
2016-10-17 07:54:06 +01:00
Daniel James
b907cee691 Use std::allocator_traits where available.
Might have to revert this when implementing C++17 features.
2016-10-14 09:27:40 +01:00
Daniel James
da6e8e8041 Better allocator rebind support 2016-10-14 09:27:40 +01:00
Daniel James
71d19820ac Fix signed conversion warnings. 2016-10-05 09:45:53 +01:00
Daniel James
d14c1dec59 Revert "Allocator aware constructors."
This reverts commit b00bc15c3e.

I messed that up a bit, will get back to it later.
2016-10-03 20:58:15 +01:00
Daniel James
ff0228e752 Support for std::piecewise_construct. 2016-10-02 17:56:01 +01:00
Daniel James
b00bc15c3e Allocator aware constructors. 2016-10-02 17:56:01 +01:00
Daniel James
e7b20d2877 Fix exception bug in asssignment.
The hash and key equality functions were assigned before allocating new
buckets. If that allocation failed, then the existing elements would be
left in place - so if accessed after the exception they could be in the
wrong buckets or equivalent elements could be incorrectly grouped
together.
2016-10-02 13:04:25 +01:00
Daniel James
e174af2286 Try not using boost::forward in emplace_args constructor.
AFAICT it's not needed since the construct arguments and the members are
the same reference type. Maybe it was for older compilers? And it appears
to be causing issues with string literals in older versions of Visual
C++.
2016-09-30 00:32:19 +01:00
Daniel James
9decbe0cbd Manually write out emplace_args for small numbers.
Still need some macros to handle rvalue reference support.
2016-09-30 00:32:19 +01:00
Daniel James
cc32bfb96f Pointless change to extract_key. 2016-09-07 09:26:25 +01:00
Daniel James
7434e116a7 Try using boost::long_long_type to avoid warning. 2016-08-29 23:03:06 +01:00
Daniel James
cae72eec2f Insert/emplace with hint. 2016-08-17 12:08:15 +01:00
Daniel James
e58370b4ff Move emplace before emplace_impl in equivalent.hpp 2016-08-17 12:08:15 +01:00
Daniel James
e92f7d86c1 Remove array_constructor.
I was using SFINAE for everything because some old compilers had issues.
But that's hopefully in the distant past now.
2016-08-14 20:55:40 +01:00
Daniel James
93a33ba15f Remove a couple of unneeded includes. 2016-08-14 20:55:40 +01:00
Daniel James
ad353c8e3d Move some of the includes up into allocate.hpp 2016-08-14 20:55:40 +01:00
Daniel James
09717ffca4 Remove a few unnecessary internal includes. 2016-08-14 20:55:40 +01:00
Daniel James
ce4b840299 Map/set details types in individual headers. 2016-08-14 20:55:40 +01:00
Daniel James
5a8df0ebe4 Hopefully a bit more readable. 2016-08-14 20:55:40 +01:00
Daniel James
6029d1cfd0 Trim down node_tmp code. 2016-08-14 20:55:40 +01:00
Daniel James
3fe46a1769 Cleaner emplace_impl in equivalent. 2016-08-14 20:55:40 +01:00
Daniel James
5490bcfe95 Remove node_tmp overload of add_node. 2016-08-14 20:55:40 +01:00
Daniel James
078c562b6c Pull some common code into a function. 2016-08-14 20:55:40 +01:00
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