I'm getting this error, which doesn't make any sense to me because the array bounds is an integer constant. Any idea why the compiler thinks it's not an integer constant?
The following code gives me the error
bar.hxx
Code:
#ifndef _BAR_H
#define _BAR_H
#include "foo.hxx"
class Bar
{
public:
Bar();
private:
int test[foo_types::MY_CONST];
};
#endif
bar.cxx
Code:
#include "bar.hxx"
int main(void)
{
Bar b;
}
foo.hxx
Code:
#ifndef _FOO_H_
#define _FOO_H_
struct foo_types
{
static const int MY_CONST;
};
#endif
foo.cxx
Code:
#include "foo.hxx"
const int foo_types::MY_CONST = 5;