Commit Graph

476 Commits

Author SHA1 Message Date
Daniel James e0054c7dd0 Remove alloc parameter from construct_value 2017-04-18 10:14:26 +01:00
Daniel James 3414e6628a Use allocator to construct/destroy nodes 2017-04-18 10:14:26 +01:00
Daniel James 08ce2c98e0 Rename call_construct to construct_value 2017-04-18 10:14:26 +01:00
Daniel James 6d79a322e2 Use macros to reduce call chain 2017-04-18 10:14:26 +01:00
Daniel James 9e70680044 Bypass construct_value/call_destroy_in a few places 2017-04-18 10:14:26 +01:00
Daniel James 7de8c91301 Remove calls to const_cast_pointer
It was needed because std::allocator_traits::construct doesn't work with
a const pointer (e.g. pointer to the first member of a std::pair). But
now we're only calling construct if BOOST_UNORDERED_CXX11_CONSTRUCTION
is true, so the allocator_traits::construct is no longer used here.
2017-04-18 10:14:26 +01:00
Daniel James c333a7f9fc Use piecewise construction where possible 2017-04-18 10:14:26 +01:00
Daniel James bc36a06a2d Comment about call_construct 2017-04-18 10:14:26 +01:00
Daniel James e62ac22f0b Replace BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT with BOOST_UNORDERED_CXX11_CONSTRUCTION
Require good construct support and piecewise construction. I don't know
if there are any platforms with good construct support, but no piecewise
construction, if there are then they'll no longer use
'allocator_traits::construct'/'allocator_traits::destruct'.
2017-04-18 10:14:26 +01:00
Daniel James 1092c972c9 Use allocator_traits to construct/destruct buckets 2017-04-18 10:14:26 +01:00
Daniel James 2b01bdbc25 More general deprecated check
`__has_cpp_attribute(deprecated)` returns true for C++11, but then warns
that it's a C++14 attribute, so only check in C++14 mode.
2017-04-16 16:34:22 +01:00
Daniel James 64a3be7d3e Use aligned_storage's address method to get pointer 2017-04-16 10:37:10 +01:00
Daniel James ed8c0f9ecd Add deprecated attributes to deprecated functions 2017-04-15 17:35:09 +01:00
Daniel James 2bfc59c461 Make node_handler constructor private + additional compile tests 2017-04-15 17:35:09 +01:00
Daniel James 727e36e6a6 Comment about clear_buckets/create_buckets awkwardness.
They both leave the container in an invalid state that needs to be
cleaned up immediately. This confused me slightly.
2017-04-15 17:35:09 +01:00
Daniel James 09bddd8df4 Clear buckets before deleting nodes in clear.
The order shouldn't really matter as nothing throws an exception, but it
seems cleaner to never have any dangling pointers.
2017-04-15 17:35:08 +01:00
Daniel James f089adc160 Change get_key to have node parameter 2017-04-15 17:35:08 +01:00
Daniel James 97b68ea05e Rename (grouped_)table_impl to table_unique/equiv
The old names don't make sense any more as either style can be used for
containers with equivalent keys, due to the use of node_algo.
2017-04-15 17:35:08 +01:00
Daniel James 972ac220f5 Add missing insert(P&&) methods to unordered_map/unordered_multimap 2017-04-15 17:35:08 +01:00
Daniel James 5d98f3d0f0 Noexcept specs for swap free functions 2017-04-15 17:35:08 +01:00
Daniel James c18f57f62b Add missing copyright/license to a couple of files 2017-04-04 22:06:15 +01:00
Daniel James 91bbd5fcb2 Make emplace_args1 constructor explicit 2017-03-01 16:46:18 +00:00
Daniel James b6e3f2303f Fix call to try_emplace_impl 2017-03-01 00:13:02 +00:00
Daniel James da370a6a1a Avoid Visual C++ warning C4127 2017-02-27 12:20:37 +00:00
Daniel James 4aa74e5feb Merge between set/multiset and map/multimap 2017-02-27 03:59:02 +00:00
Daniel James 13322fe858 Option to use same node type everywhere.
Will allow me to implement merge and extract fully.
2017-02-27 03:59:02 +00:00
Daniel James 0645700b33 Separate out some of the node manipulation code 2017-02-27 03:59:02 +00:00
Daniel James d89aadc56c Implement merge 2017-02-27 03:59:02 +00:00
Daniel James 21a24d6cd7 Support node_handle 2017-02-27 03:59:02 +00:00
Daniel James 9c4c3a754a Const methods in value_base. 2017-02-27 03:59:02 +00:00
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