The warning 'Access of moved variable other' comes up quite frequently when the code is ok. It occurs with move constructors when there are base classes. Could this be fixed?
There is public inheritance of base classes A, B and D. The reference of C converts implicitly to a reference of A, B and D. The same warning also occurs with move assignment operators.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The warning 'Access of moved variable other' comes up quite frequently when the code is ok. It occurs with move constructors when there are base classes. Could this be fixed?
E.g;
C::C(C &&other) noexcept :
A(std::move(other)),
B(std::move(other)),
D(std::move(other)) {
}
The example is incomplete. But how can moving three times from the same value be OK?
There is public inheritance of base classes A, B and D. The reference of C converts implicitly to a reference of A, B and D. The same warning also occurs with move assignment operators.
This still sounds dubious, but without a compilable example, it's hard to tell.