Hi, I came across an outdated code and I came across a wierd method definition / declaration. I have a reasonable assumption that he does, but I can’t be 100% sure.
declaration:
const SomeEnumeratedId (&SomeMethod() const)[SOME_CONSTANT_VALUE];
definition
const SomeEnumeratedId (&SomeClass::SomeMethod() const)[SOME_CONSTANT_VALUE]
{
return someMemberArray;
}
My best guess is that it passes a reference to someMemberArray and ensures that it is SOME_CONSTANT_VALUE in size, but I never saw the [] notation after declaring the method as it appears, and there are so many parentheses.
Any help is greatly appreciated.
source
share