#11697 closed Bugs (fixed)
Boost.Container: Wrong initialization order in tuple copy-constructor
Reported by: | Owned by: | Ion Gaztañaga | |
---|---|---|---|
Milestone: | To Be Determined | Component: | container |
Version: | Boost 1.59.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Hello,
In the file
boost/container/detail/variadic_templates_tools.hpp
in line 57 there is a bug because the inherited class comes in the initialization list after the member. The code should read
Construct tuple from another tuple. template<typename... VValues> tuple(const tuple<VValues...>& other)
: m_head(other.head()), inherited(other.tail()) : inherited(other.tail()), m_head(other.head())
{}
Best regards, Manuel
Change History (4)
comment:1 by , 7 years ago
Component: | None → container |
---|---|
Owner: | set to |
comment:2 by , 7 years ago
comment:3 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks for the report. Inherited will always be constructed first, as the initialization order is fixed by the language despite the initialization list. In any case, it's misleading and it should be corrected. Fixed in commit:
https://github.com/boostorg/container/commit/79274e4aae91c563be1e49046bdf98b589d35294
comment:4 by , 7 years ago
The code was not wrong, I should have been clearer in my wording. The "problem" is that our compiler (ARMCC) reports a warning in this case. Thanks for silencing it! :-)
Second try (now with the code embedded in a code block):