L
Lutz Altmann
hello,
i try to write a class-function which can return two arguments by
reference.
My idea was to encapsulate the references in a struct :
struct DataUnit
{
SomeClassType& m_object1;
SomeOtherClassType& m_object2;
};
So that the function can return the two references by using the
struct :
DataUnit processSomething();
My question is: How can i create the struct in the function ?
I've tried the following:
DataUnit returnValue = { m_someobject1,m_someobject2};
but it doesnt work.
Is there a way to initialize the references ? maybe there is another/
better
way to return two references from the function?
Note: The function-caller only has access to the interface of the
classes (of the return references)!
Thanks in advance,
Lutz
i try to write a class-function which can return two arguments by
reference.
My idea was to encapsulate the references in a struct :
struct DataUnit
{
SomeClassType& m_object1;
SomeOtherClassType& m_object2;
};
So that the function can return the two references by using the
struct :
DataUnit processSomething();
My question is: How can i create the struct in the function ?
I've tried the following:
DataUnit returnValue = { m_someobject1,m_someobject2};
but it doesnt work.
Is there a way to initialize the references ? maybe there is another/
better
way to return two references from the function?
Note: The function-caller only has access to the interface of the
classes (of the return references)!
Thanks in advance,
Lutz