B
Barzo
Hi,
I'm a little bit confusing about the enumerations scope into
namespaces.
I have this situation where MyLib.h is the interface header supplied
to the customers.
1. Is this a valid approch?
2. The MyLib.cpp build fails...I have to specify the
IMyBaseClass::MyEnum for each enumeraton?
MyLib.h
--------
namespace MyNamespace
{
class IMyBaseClass
{
enum MyEnum
{
VAL_A,
VAL_B
}
virtual MyEnum f() = 0;
}
class IMyClass : public IMyBaseClass
{
virtual void g( MyEnum value) = 0;
}
}
MyLibImpl.h
------------
#include "MyLib.h"
namespace MyNamespace
{
class MyClass : public IMyClass
{
virtual MyEnum f();
void g( MyEnum value );
}
}
MyLibImpl.cpp
-------------
#include "MyLib.h"
#include "MyLibImpl.h"
using namespace MyNamespace;
using MyNamespace::IMyBaseClass;
MyEnum MyClass::f()
{
...
};
void MyClass::g( MyEnum value )
{
...
};
Thanks.
Daniele.
I'm a little bit confusing about the enumerations scope into
namespaces.
I have this situation where MyLib.h is the interface header supplied
to the customers.
1. Is this a valid approch?
2. The MyLib.cpp build fails...I have to specify the
IMyBaseClass::MyEnum for each enumeraton?
MyLib.h
--------
namespace MyNamespace
{
class IMyBaseClass
{
enum MyEnum
{
VAL_A,
VAL_B
}
virtual MyEnum f() = 0;
}
class IMyClass : public IMyBaseClass
{
virtual void g( MyEnum value) = 0;
}
}
MyLibImpl.h
------------
#include "MyLib.h"
namespace MyNamespace
{
class MyClass : public IMyClass
{
virtual MyEnum f();
void g( MyEnum value );
}
}
MyLibImpl.cpp
-------------
#include "MyLib.h"
#include "MyLibImpl.h"
using namespace MyNamespace;
using MyNamespace::IMyBaseClass;
MyEnum MyClass::f()
{
...
};
void MyClass::g( MyEnum value )
{
...
};
Thanks.
Daniele.