Boost logo

Boost Users :

From: Antonio Piccolboni (piccolbo_at_[hidden])
Date: 2006-01-14 21:44:20


I have a 4D multi_array and I define a 3D view on it. I can assign the
view to a 3D multi array but I can't pass it directly to a constructor
that takes a 3D multi_array. Isn't a 3d view on anything a model of a
3d multi_array? (for the sake of this discussion, element is always
double).

Code:
#include <boost/multi_array.hpp>

using namespace boost;

class moviva {
public:
  moviva(multi_array<double, 3> m) {}
};

main(){
  typedef multi_array<double, 4> array_type;
  typedef array_type::index_range range;

  multi_array<double, 4> ta4;
  multi_array<double, 3> ta3;

  ta3 = ta4[indices[range()][range()][range()][1]];

  moviva ma(ta3); // compiles
  moviva ma1 (ta4[indices[range()][range()][range()][1]]); //does not, line 20
}

Compilation
view_test.cpp: In function `int main()':
view_test.cpp:20: error: no matching function for call to `moviva::moviva(
   boost::detail::multi_array::multi_array_view<double, 3>)'
view_test.cpp:5: error: candidates are: moviva::moviva(const moviva&)
view_test.cpp:7: error:
   moviva::moviva(boost::multi_array<double, 3, std::allocator<double> >)

Thanks

Antonio


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net