Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct or improve C++11 and higher allocator support #379

Closed
2 tasks done
glenfe opened this issue Mar 23, 2017 · 0 comments
Closed
2 tasks done

Correct or improve C++11 and higher allocator support #379

glenfe opened this issue Mar 23, 2017 · 0 comments

Comments

@glenfe
Copy link
Contributor

glenfe commented Mar 23, 2017

To correctly support the C++ allocator model, or otherwise simplify allocator-aware code.

  1. 1. When the C++11 allocator model is available (i.e. BOND_NO_CXX11_ALLOCATOR is not defined) to rebind an allocator type A for type T, should always use std::allocator_traits<A>::template rebind_alloc<T> as I did in the recent Improvements and fixes for C++ nullable implementation and reduce dynamic allocation  #174 nullable changes. This is because a valid C++ allocator is no longer required to provide a rebind member template.
  2. 2. The integral constant expression for the detection of the Default Allocator can be simplified by a writing trait is_default_allocator<A> that is the integral constant true_type when the given allocator is the Default Allocator, and false_type otherwise.
chwarr added a commit to chwarr/bond that referenced this issue Mar 28, 2017
* Support C++11 and above allocator model for rebind
* Simplify detection of the default allocator

Closes microsoft#379
Closes microsoft#380
@chwarr chwarr closed this as completed in 5875dcc Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant