I'm really not sure why it fails to compile, the error message isn't very
helpful. I assume it might be because allocator1 has an explicit default
constructor, so I tried making it implicit.
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).
The rebind mechanism doesn't work for templates with multiple template
parameters on old versions of GCC. But allocators written for that
compiler will have an explicit rebind, so that should be acceptable.
This time for a more limited range of values so that equal values turn
up more often. This is a bit shoddy, but seems like the best way to
improve the existing tests without too much effort.
This was causing the hash function to be different to the equality
function. For some reason this resulted in a lot of windows test
failures, but none on linux or os x. I'm a bit confused and worried
about that.
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.
It looks the odd result in unnecessary_copy_tests on Visual C++ 11 is not a
bug, but add some extra tests just to make sure. Also some extra rehash and
reserve testing thrown in.
[SVN r80705]
Assigning a container requires that its elements can be assignable. Could split
the tests up so that other tests aren't assignable, but it doesn't seem worth
the hassle.
[SVN r80228]
It was originally introduced because of some issues with Boost.Test and older
compilers, neither of which I'm using now. Simplifies a few things.
[SVN r79352]
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]
- Simplify mechanism for detecting traits of test allocators. There were
some portability issues, but rather than fix them I've just gone for a
simpler mechanism. Does mean that the relevant tests can't be run for
other allocators.
- Fix a couple of unnecessary_copy_tests, whose results were the wrong
way round.
- It appears that Visual C++ only implements RVO for implicitly defined
copy constructors in debug mode, so adjust a move_test to account for
the extra copies now that the copy constructors are explicitly
defined.
[SVN r73798]
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]