Boost logo

Boost Users :

Subject: [Boost-users] [multi_array] pointer type - does not compile
From: Suresh Kumar (suresh.amritapuri_at_[hidden])
Date: 2010-09-20 18:46:35


Hi
The following code does not compile.

#include <boost/multi_array.hpp>
#include <iostream>

int
main () {

  typedef boost::multi_array<int, 3> array_type;
  typedef array_type::index index;
  array_type * A;
  A = new array_type(boost::extents[3][4][2]);
  array_type::extent_gen extents;

  A[0][0][0] =1;
  return 0;
}

gives large number of errro messages of which some are given below.
/usr/include/boost/multi_array/concept_checks.hpp:92: error: ‘int’ is not a
class, struct, or union type
/usr/include/boost/multi_array/concept_checks.hpp:71: error: using invalid
field ‘boost::detail::multi_array::ConstMultiArrayConcept<Array,
NumDims>::id’

I am using a pointer type because, the size of the multi_array is only known
at run time and I want the multi_array to be a private data element of a
class so that the methods can store data in my multi_array.

Thanks for suggestions
suresh

-- 
R Suresh Kumar,
http://www.ee.ucr.edu/~sramachandranna
Sarve bhavantu sukinaha (May everyone be happy)
Sarve santu niramiyaha (May everyone be without affliction)
Sarve bhadrani pashyantu (May everyone see only goodness)
Ma kashchit dukha bhak bhavet (Let none be the victim of suffering)


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