In my C++ class I need to assign a method with pointer and/or reference. So I do this tricky thing :
(Assuming aclass is a class variable AnotherClass *)
void MyClass::setElem(AnotherClass *pVal)
{
aclass = pVal;
}
void MyClass::setElem(AnotherClass &refVal)
{
aClass = &article;
}
But in my opinion, sounds not so "graceful"...
Better way to achieve this ?