This will create an RCUPtr<T> from an RCUPtr<U> if U * is implicitely convertible to T *. This will come in handy for converting RCUPtr<T> to RCUPtr<const T>.
Details
Details
- Reviewers
deadalnix - Group Reviewers
Restricted Project - Commits
- rABC7b1b9f8c381c: [RCU] Add an implicit converting constructor
ninja check
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
src/rcu.h | ||
---|---|---|
159 ↗ | (On Diff #33642) | This needs to go as the copy constructor, and so you also need an assignment operator to go with this. |
src/rcu.h | ||
---|---|---|
144 ↗ | (On Diff #33646) | This works also if U == T, no? Why is the non template copy constructor needed? |
src/rcu.h | ||
---|---|---|
144 ↗ | (On Diff #33646) | That's what I thought as well but my compiler disagreed. It seems you can't have a template copy constructor: https://stackoverflow.com/questions/55845896/why-doesnt-the-standard-consider-a-template-constructor-as-a-copy-constructor Also what happens here if you remove that copy constructor is that it is implicitly deleted because there is also a move constructor defined, and this implicitly deleted copy constructor takes precedence to the template resolution so your compiler will refuse to build. |