Commit Graph

1248 Commits

Author SHA1 Message Date
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
Daniel James
da835e88b8 Expand calls to insert_range 2017-04-23 10:09:18 +01:00
Daniel James
b6c229e2bb Expand calls to reserve implementation 2017-04-23 10:09:18 +01:00
Daniel James
19a45e028a Expand calls to generic_find_node 2017-04-23 10:09:18 +01:00
Daniel James
435b7450d4 Expand calls to max_size implementation 2017-04-23 10:09:18 +01:00
Daniel James
a41a0f3a06 Expand calls to load_factor implementation 2017-04-23 10:09:18 +01:00
Daniel James
814926ef31 Expand calls to clear implementation 2017-04-23 10:09:18 +01:00
Daniel James
f6f5ecdc00 Expand calls to emplace implementation
Also manually call the emplace macro up to 9 arguments, nicer error
messages for little effort.

Does it matter that there's no longer a nice backend for
`please_ignore_this_overload`? I don't think so, I was worried that it
would be confusing if triggered, but I'm not really aware of that ever
happening.
2017-04-23 10:09:18 +01:00
Daniel James
42b6b13943 Use the preprocessor to increment emplace limit
So that there's no need to add one.
2017-04-23 10:04:28 +01:00
Daniel James
cfe4c26f99 Explicitly write out boost::tuple template arguments
GCC 4.6 doesn't support using variadic arguments for a fixed length template.
There's a config macro for this, but might as well use the same code
everywhere.
2017-04-23 09:31:18 +01:00
Daniel James
3117611a55 New tuple implementation
Adjusts to use less arguments on Visual C++ 11, which will hopefully fix
it on that compiler. Also changed to be a little less preprocessor
heavy. I'm not sure about the __SUNPRO_CC support, hopefully recent
versions of that compiler will have better support, and can use the
normal implementation. Will check that later.
2017-04-22 18:31:10 +01:00
Daniel James
1e491533fa More consistent std::tuple configuration
Was getting a weird test failure for Visual C++ 11,
BOOST_NO_CXX11_HDR_TUPLE is defined, so the code doesn't support
std::tuple, but BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT was also
true, and so there are functions for constructing using
std::piecewise_construct/std::tuple, which don't work.

So, I'm assuming that if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT is true,
then there must be a std::tuple. I guess it doesn't have full C++11 support,
which is why BOOST_NO_CXX11_HDR_TUPLE is defined, but it appears to be
good enough for us. If not, this will break things.
2017-04-21 20:32:56 +01:00
Daniel James
a119caaa1b Stop travis build after first failure 2017-04-20 23:39:44 +01:00
Daniel James
96f8f85eef Use environment variable to set user-config.jam 2017-04-20 23:39:44 +01:00
Daniel James
2add451d63 Use boost 1.64.0 on travis 2017-04-20 23:11:28 +01:00
Daniel James
3effedb728 Merge branch 'feature/standards-checking-and-cleanup' into develop
Rearrange the definitions to be a closer match to the standard, this
should make it easier to check how standards compliant it is. Also, some
minor code clean-ups that I noticed while doing this.
2017-04-20 23:01:09 +01:00
Daniel James
b067e65731 Clean table forward declarations 2017-04-20 22:59:00 +01:00
Daniel James
f3b179d451 Remove pointless duplication of move constructor 2017-04-20 22:59:00 +01:00
Daniel James
de5373413b Missing rvalue overload of at 2017-04-20 22:59:00 +01:00
Daniel James
fedf533699 Move index functions into place 2017-04-20 22:59:00 +01:00
Daniel James
9cd673c71d Specify clear as noexcept 2017-04-20 22:59:00 +01:00
Daniel James
85a834cf62 Comment on changes needed for C++17 support 2017-04-20 22:59:00 +01:00
Daniel James
5167c970af Swap order of swap/clear to match standard 2017-04-20 22:59:00 +01:00
Daniel James
bf7a65010c Add new erase(iterator) overloads
Not for unordered_set/unordered_multiset as they use the same type for
iterator and const_iterator.
2017-04-20 22:59:00 +01:00
Daniel James
461ac96a2c Reorder insert_or_assign to match standard 2017-04-20 22:59:00 +01:00
Daniel James
5eb10fd0b2 Move extract into place 2017-04-20 22:59:00 +01:00
Daniel James
e2e9959389 Split up emplace and emplace_hint code
Busywork I guess, but I think it's more readable this way. The emplace
macros are still unreadable, but I think they're rarely used.

Btw. a bit weird that clang format has removed the indentation on the
'// emplace' comment, not sure why that is.
2017-04-20 22:59:00 +01:00
Daniel James
d8969c71fc Move 'try_emplace' into same order as draft standard 2017-04-20 22:59:00 +01:00
Daniel James
ab76814aa6 Move 'insert_or_assign' into same order as draft standard 2017-04-20 22:59:00 +01:00
Daniel James
1a18cd2196 Move capacity functions to match order in standard 2017-04-20 22:59:00 +01:00
Daniel James
e4a00980f8 Commented out noexcept for move assignment 2017-04-20 22:59:00 +01:00
Daniel James
af94e6a40e Reorder the constructors to match the draft standard
In order to make it easier to check against the standard.  This includes
collapsing some of the input iterator overloads into one constructor.
2017-04-20 22:59:00 +01:00
Daniel James
ee73a53497 Disable failing tests on gcc 4.6/4.7 c++11 mode
Works fine on later versions of GCC, I suspect it's a bug in their
noexcept support.
2017-04-20 10:11:01 +01:00