Commit Graph

417 Commits

Author SHA1 Message Date
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