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
- Branch
- rcu_implicit_converting_constructor
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 19124 Build 37996: Build Diff build-without-wallet · lint-circular-dependencies · build-debug · build-clang · build-diff · build-clang-tidy Build 37995: arc lint + arc unit
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 | This works also if U == T, no? Why is the non template copy constructor needed? |
src/rcu.h | ||
---|---|---|
144 | 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. |