[la] VectorInterface::operator= broken
Using =
on a vector object works, but not if accessed via the interface. I.e., the following code
using V = XT::LA::IstlDenseVector<double>;
V one(4, 1.);
std::cout << "one = " << print(one) << std::endl;
auto& one_as_if = static_cast<XT::LA::VectorInterface<typename V::Traits>&>(one);
std::cout << "one_as_if = " << print(one_as_if) << std::endl;
V two(4, 2.);
std::cout << "two = " << print(two) << std::endl;
one_as_if = two;
std::cout << "one_as_if = " << print(one_as_if) << std::endl;
one_as_if.as_imp() = two;
std::cout << "one_as_if = " << print(one_as_if) << std::endl;
gives the following output
one = [1, 1, 1, 1]
one_as_if = [1 1 1 1]
two = [2, 2, 2, 2]
one_as_if = [1 1 1 1] // <-
one_as_if = [2 2 2 2]
(except for the comment to mark the offending line). A one-shot debug attempt did not yield anything (the operator=
was not even entered).
I do not really have time to pursue this atm, but I think this is a serious issue, possibly affecting the operator=
of other CRTP interfaces. @l_tobi01 @r_milk01