I am writing a C++ wrapper for a C library. In the C library, I have a
typedef enum {bar1,bar2} Foo; /* this is defined in the C library */
that I'd like to "bring" into a C++ namespace. I am using
namespace X{
using ::Foo;
}
to achieve this. However, to qualify the enum members, I always have to refer to them as
X::Foo::bar1
and so on. Is there any way whatsoever of "importing" the C enum into a C++ namespace but refer directly to the values of the enum as
X::bar1
and so on? Or, in other words, can I import directly the values of the enum into the namespace?
EDIT
I do not think the question is a dupe, please see my answer as I realized there is a solution.