xreducer is an xsharable_expression, but attempting to call xt::make_xshared results in a compiler error because xreducer does not have the full interface expected by xshared_expression.
A simple example:
#include <xtensor/containers/xtensor.hpp>
#include <xtensor/generators/xrandom.hpp>
int main()
{
size_t n = 1000;
size_t m = 9;
size_t o = 12;
xt::xtensor<double, 3> tensor = xt::random::rand({n, m, o}, -20., 20.);
auto result = xt::make_xshared(xt::sum(tensor, {2}));
}
On Compiler Explorer: https://godbolt.org/z/xbn19Poes
Whether you argue you should or shouldn't share a reducer, the end result in my opinion should not be for it to fail during instantiation of xshared_expression<xreducer<...>>. Reducer should either be stripped of its xsharable_expression-ness, the xshared_expression should include requires statements that disable unavailable methods, or xreducer should have its interface updated to include those currently non-extant methods.
xreducer is an xsharable_expression, but attempting to call xt::make_xshared results in a compiler error because xreducer does not have the full interface expected by xshared_expression.
A simple example:
On Compiler Explorer: https://godbolt.org/z/xbn19Poes
Whether you argue you should or shouldn't share a reducer, the end result in my opinion should not be for it to fail during instantiation of xshared_expression<xreducer<...>>. Reducer should either be stripped of its xsharable_expression-ness, the xshared_expression should include requires statements that disable unavailable methods, or xreducer should have its interface updated to include those currently non-extant methods.