Boost logo

Boost Users :

From: Sergio Ferrari (fsdevsw_at_[hidden])
Date: 2004-10-02 16:24:06


Hi to all.
Sorry for my English.
I'm trying to use a boost::multi_array as a private member of a class.
How I can specifying the number of elements for every dimensions into
the constructor?

#include <iostream>
#include "boost/multi_array.hpp"
using namespace std;

typedef boost::multi_array<int, 2> table;
class X
{
public:
    X();
    ~X(){};
    // ...
    void do_something();
private:
     table tab;
     boost::array<table::index, 2> dims;
     
};
 
X::X()
{
    dims = {{3, 5}}; // fails
    table(dims);
}
 
int main()
{
  X x;
  
  x.do_something();
  
  system("PAUSE");
  return 0;
}
 
Thanks to all.
Sergio

                
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.



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