Boost logo

Boost Users :

Subject: Re: [Boost-users] eigen2 and multi_array
From: Suresh Kumar (suresh.amritapuri_at_[hidden])
Date: 2010-09-16 18:26:29


On Thu, Sep 16, 2010 at 11:59 AM, Suresh Kumar
<suresh.amritapuri_at_[hidden]>wrote:

> On Thu, Sep 16, 2010 at 12:33 AM, alfC <alfredo.correa_at_[hidden]> wrote:
>
>> > typedef multi_array<double, 2> array_type;
>> > array_type scores(extents[1][1]);
>> >
>> > compiler error: ‘extents’ is not a type
>> >
>> > Any suggestions?
>>
>> make sure you are using "boost::extents" (i.e. in namespace boost).
>> (also note that boost::extents is not a type but a --static-- object)
>
>
> I get the same error still: error: ‘boost::extents’ is not a type
>
> Any ideas/suggestions?
>

SOLVED. I was trying to do the above in the private part of a class. Once I
realised that extents is a static object, i defined my class like this.
class c{
  private:
    array_type * scores;
 public:
    c(){
      scores = new array_type(boost::extents[1][1]);
    }
};

But I still have one more question. How can I use it without using pointers?
thanks
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