GQ Chen wrote:
Hi,
I have some troubles in compiling the following simple code, tboost.hpp, tboost.cpp The problem is always from the declaration of array_type A(boost::extents[2000000][1]);
in the header file.
Error message from compiling,
In file included from tboost.cpp:2: tboost.h:14: error: `extents' has not been declared boost.h:14: error: ISO C++ forbids declaration of `parameter' with no type
If I define array_type A(boost::extents[2000000][1]); in the source code tboost.cpp, it will compile successfully.
Could anyone help me to solve it? Thanks a lot,
gq
tboost.hpp
#include <cassert> #include
#include <iostream> #include "boost/multi_array.hpp" typedef boost::multi_array
array_type; class tboost { public: tboost(){}; ~tboost(){}; public: array_type A(boost::extents[2000000][1]); };
#endif
tboost.cpp
#include "tboost.h" int main () { char c =getchar(); return 0; } _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi, use the constructors initializer list... class tboost { public: array_type A; tboost( void ) : A(boost::extents[2000000][1]) { } }; -- HTH, dave