Reflex access to namespace constants

Hello,

I have a namespace of constants which I am trying to access using Reflex. Here is a primitive example:

namespace MyNamespace
{
static const int MyConstInt = 1;
static const double MyConstDouble = 3.14;
}

I find that I cannot access these constants using Reflex. I can access the MyNamespace Scope using:

ROOT::Reflex::Scope::ByName(“MyNamespace”)

but I find no path to access the static constants. In the root/reflex/test directory I find an example of such a constant, but it is accessed using a separate class:

(taken from root/reflex/test/testDict2/TestClasses.h)

static const int staticint = 1;

class TestFunctionReturnTypes {
public:


const int & returnRef1() { return staticint; }

};

Is this the only method for accessing static constants using reflex?

Thanks,
Dan

Hi,

it’s a bug in Reflex; see savannah.cern.ch/bugs/?29059 for when it will be resolved. Until then you’ll have to wrap it in a function (which doesn’t need to be a class member).

Cheers, Axel.