[libc++] Fix PR22922 - Allocator support for std::function does not know how to rebind.
Summary: This patch changes std::function to use allocator_traits to rebind the allocator instead of allocator itself. It also changes most of the tests to use `bare_allocator` where possible instead of `test_allocator`. Reviewers: mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8391 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@232686 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,10 +16,12 @@
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_allocator.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
std::function<int(int)> f(std::allocator_arg, test_allocator<int>());
|
||||
{
|
||||
std::function<int(int)> f(std::allocator_arg, bare_allocator<int>());
|
||||
assert(!f);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user