I have the following header file:
namespace First
{
namespace Second
{
class Limit
{
public:
enum Status
{
GOOD,
BAD
};
}
}
}
Since it’s proprietary I have changed the names, and only left the relevant info.
In my own class I have…
First::Second::Limit::Status limit_status = First::Second::Limit::Status::OK;
But I get an error:
error: class First::Second::Limit::Status is not a class or namespace
I am able to declare a variable of that enum, but not set it to any of the values. How do I fix this?
You don’t need the
Statusbit. Think of it as defining severalconst ints insideLimit, you wouldn’t sayLimit::int::GOOD.