O
osama178
Let's say I have this code
--------------------
class GenericQueue
{
bool Pop(void*& refToPtr); // //--------------------(1)
};
class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return GenericQueue:op(refToPtr); //--------------------(2)
}
};
..... The statement in (2) generates an error.
I know it doesn't compile because we're passing a pointer in (2) to a
function that expects a reference to a pointer, but as soon as we go
into the code block in (2), refToPtr becomes just the pointer. How do
I get it as a reference to pointer so I can pass it correctly?
Thanks
--------------------
class GenericQueue
{
bool Pop(void*& refToPtr); // //--------------------(1)
};
class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return GenericQueue:op(refToPtr); //--------------------(2)
}
};
..... The statement in (2) generates an error.
I know it doesn't compile because we're passing a pointer in (2) to a
function that expects a reference to a pointer, but as soon as we go
into the code block in (2), refToPtr becomes just the pointer. How do
I get it as a reference to pointer so I can pass it correctly?
Thanks