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

allocator_arg and piecewise_construct should use {} #250

Closed
StephanTLavavej opened this issue Dec 17, 2013 · 0 comments
Closed

allocator_arg and piecewise_construct should use {} #250

StephanTLavavej opened this issue Dec 17, 2013 · 0 comments

Comments

@StephanTLavavej
Copy link
Contributor

N3797 20.7.2 [memory.syn] and 20.7.6 [allocator.tag] say:

constexpr allocator_arg_t allocator_arg = allocator_arg_t();

20.2 [utility] and 20.3.5 [pair.piecewise] say:

constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();

This obeys 8.5 [dcl.init]/7 "If a program calls for the default initialization of an object of a const-qualified type T, T shall be a class type with a user-provided default constructor.", but it's verbose. With C++11 tech, we can do better:

constexpr allocator_arg_t allocator_arg{};

constexpr piecewise_construct_t piecewise_construct{};
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