Opened 12 years ago
Closed 12 years ago
#4213 closed Patches (fixed)
can't have const value_initialized members
Reported by: | Chris Jefferson | Owned by: | No-Maintainer |
---|---|---|---|
Milestone: | Boost 1.43.0 | Component: | utility |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
Code like:
const value_initialized<int> x;
Is invalid in clang and comeau, as they correctly (I believe) reject default initialization of const objects without a user-provided default constructor.
The attached patch adds a default constructor, along with a copy constructor and operator=, just for consistency. It makes clang++ pass all tests for utility, and does not make g++ fail any.
Attachments (1)
Change History (4)
by , 12 years ago
Attachment: | value_init.hpp.patch added |
---|
comment:1 by , 12 years ago
Component: | None → utility |
---|---|
Owner: | set to |
Version: | Boost Release Branch → Boost Development Trunk |
The regression failures were caused by my commit [61883], which reimplemented value_initialized<T> in terms of initialized<T>. See also: [boost] Patch to value_initialized, May 13, 2010.
comment:2 by , 12 years ago
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
While yesterday, the test output of value_init_test had compile errors for clang-darwin-2.0 (error: default initialization of an object of const type 'boost::value_initialized<int> const' requires a user-provided default constructor), this morning the errors are gone. (Looking at http://www.boost.org/development/tests/trunk/developer/utility_.html) So [61947] resolved the issue. Thanks, Chris!
Patch to value_init.hpp