Opened 10 years ago
Closed 10 years ago
#7381 closed Bugs (fixed)
C++11 compliance: unresolved symbol when assigning a constexpr duration to a non-const local variable
Reported by: | viboes | Owned by: | viboes |
---|---|---|---|
Milestone: | Boost 1.52.0 | Component: | chrono |
Version: | Boost 1.51.0 | Severity: | Problem |
Keywords: | constexpr duration | Cc: |
Description
When assigning a template static value member of type constexpr boost::chrono::duration to a non-const local variable
template <int Val, typename Type> struct dummy { typedef Type type; static constexpr type value{static_cast<type>(Val)}; }; void aTest(){ auto z3 = dummy2<7,boost::chrono::hours>::value; }
There is an unresolved symbol link error.
The reason is that the boost::chrono::duration copy constructor must be =default on c++11 so that the type can be used as a constexpr.
Removing the following declaration in boost/chrono/duration
BOOST_CONSTEXPR duration(const duration& rhs) : rep_(rhs.rep_) {} // = default;
solves the issue.
Change History (4)
comment:1 by , 10 years ago
Status: | new → assigned |
---|
comment:2 by , 10 years ago
Component: | thread → chrono |
---|
comment:3 by , 10 years ago
Keywords: | constexpr duration added |
---|---|
Milestone: | To Be Determined → Boost 1.52.0 |
Note:
See TracTickets
for help on using tickets.
Committed in trunk revision [80536].