M
mackenzie
Hello,
I am looking for a little bit of help. I am trying to create a
dynamically allocated object which contains one or more objects of
type boost:ool<>. I get a compiler error when an object of this type
is contained in my class and am not sure why. To be honest I have a
little but not a lot of experience with templates and it could simply
be obvious to a more experienced template user; however, the answer
escapes me.
Here is a sample code snippet:
#include <boost/pool/pool.hpp>
#include <boost/pool/singleton_pool.hpp>
struct Foobar
{
boost:ool<> p(sizeof(int)); // this is line 182
};
boost:ool<> yp(512);
int main()
{
Foobar foobar;
printf( "%u\n", sizeof( boost:ool<>(512) ) );
return( 0 );
}
----------------------
Here is the error message:
ramMgr.cxx:182: error: expected identifier before #sizeof#
ramMgr.cxx:182: error: expected #,# or #...# before #sizeof#
---------------------------
compiler & version
g++ -v
gcc version 4.1.1 20060724 (4.1.1-3mdk)
Thanks,
Parker
I am looking for a little bit of help. I am trying to create a
dynamically allocated object which contains one or more objects of
type boost:ool<>. I get a compiler error when an object of this type
is contained in my class and am not sure why. To be honest I have a
little but not a lot of experience with templates and it could simply
be obvious to a more experienced template user; however, the answer
escapes me.
Here is a sample code snippet:
#include <boost/pool/pool.hpp>
#include <boost/pool/singleton_pool.hpp>
struct Foobar
{
boost:ool<> p(sizeof(int)); // this is line 182
};
boost:ool<> yp(512);
int main()
{
Foobar foobar;
printf( "%u\n", sizeof( boost:ool<>(512) ) );
return( 0 );
}
----------------------
Here is the error message:
ramMgr.cxx:182: error: expected identifier before #sizeof#
ramMgr.cxx:182: error: expected #,# or #...# before #sizeof#
---------------------------
compiler & version
g++ -v
gcc version 4.1.1 20060724 (4.1.1-3mdk)
Thanks,
Parker