Hi to all,
for start i would like to say that i am newbie.
i am trying to initialized boost:multi_array inside my class. I know how to create a boost:multi_array:
boost::multi_array<int,1> foo ( boost::extents[1000] );
but as part of a class i have problems:
class Influx {
public:
Influx ( uint32_t num_elements );
boost::multi_array<int,1> foo;
private:
};
Influx::Influx ( uint32_t num_elements ) {
foo = boost::multi_array<int,1> ( boost::extents[ num_elements ] );
}
my program pass compilation but during run-time i get an error when i try to accuse an element from foo (e.g. foo[0]
).
since i am newbie, don't really know how to solve this problem.
regards