|
Boost Users : |
From: Karim Bakir (rimbak_at_[hidden])
Date: 2006-04-05 16:48:42
I use multi array boost
But I have problem : - I can't declare a multi array as a member variable , I have the error: unexpected "error C2321: syntax error : unexpected 'boost::extents"
When I don' write the keyword "typdef" I have more mistakes.
//Boost library
#include <Boost/multi_array.hpp>
#include <cassert>
//Name Space
using namespace std;
using namespace boost;
class MyClass
{
typedef boost::multi_array<double,2>array_type_2d;
public:
MyClass();
virtual ~MyClass();
array_type_2d M(boost::extents[10][10]);
};
So I want to have : but I don't manage it.
//myClass.h
//////////////////////////
//Boost library
#include <Boost/multi_array.hpp>
#include <cassert>
//Name Space
using namespace std;
using namespace boost;
class myClass
{
boost::multi_array<double,2>array_type_2d;
private :
int dim1, dim2;
array_type_2d MyMatrice(boost::extents[dim1][dim2]) ;
array_type_2d MySecondMatrice(boost::extents[10][10]) ;
};
//myClass.cpp
////////////////////////////////
void myClass::tester()
{
for (int i= 0 ; i<dim1; +)
for(int j=0;j<dim2;j++)
MyMatrice[i][j] = 15;
}
for ( i= 0 ; i<10; +)
for(int j=0;j<10;j++)
MySecondMatrice[i][j] = 0;
}
Thankssss
___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com
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