blitzpp / blitz

Blitz++ Multi-Dimensional Array Library for C++
https://github.com/blitzpp/blitz/wiki
Other
405 stars 84 forks source link

indirection example in section 6.1 of the manual does not compile #69

Open slayoo opened 5 years ago

slayoo commented 5 years ago

Migrated from: https://sourceforge.net/p/blitz/bugs/58/

The manual includes the following code in section 6.1:

Array<int,1> A(5), B(5);
A = 0;
B = 1, 2, 3, 4, 5;
vector<int> I;
I.push_back(2);
I.push_back(4);
I.push_back(1);
A[I] = B;

It fails to compile with current Blitz with the following error:

/usr/include/blitz/array/indirect.h:95:10: error: no matching member function for call to 'moveTo'
expr.moveTo(subdomain);
~~~~~^~~~~~
/usr/include/blitz/array/indirect.h:79:9: note: in instantiation of function template specialization
'blitz::applyOverSubdomain<blitz::Array<int, 1="">, blitz::FastArrayIterator<int, 1="">, int, blitz::bz_ArrayExpr<blitz::FastArrayIterator<int, 1=""> > >' requested here
applyOverSubdomain(array, arrayIter, subdomain, expr);
^
aqq.cpp:17:6: note: in instantiation of function template specialization 'blitz::IndirectArray<blitz::Array<int, 1="">, std::vector<int, std::allocator<int=""> > >::operator=<blitz::Array<int, 1=""> >' requested here
A[I] = B;
^
/usr/include/blitz/array/expr.h:285:10: note: candidate template ignored: could not match 'TinyVector<int, N_rank="">' against 'int'
void moveTo(const TinyVector<int, N="">& i)
^