Yes, for all functions in general, and yes it's my own class.
I'm trying to prevent it because it's dangerous (for this class; it's not design to be passed by reference).
I also encountered something weird:
Code:
ppnew<int>* pTest2 = new ppnew<int>;
Of course it complains that it can't access private operator new, but it also complains it can't access private operator delete.
If I make delete public or remove it, it compiles but there's no call to delete.
Is it a safety precaution seeing as that after you allocate it, you can't delete it?
So far, here's what I have:
Code:
void foo(pp<int>&);
void foo(pp<int>*);
ppnew<int> pTest; // Works, and should work
ppnew<int>* pTest2 = new ppnew<int>; // Does not work - can't call private operator new and private operator delete, as it should be
foo(pTest); // Works, but shouldn't! BAD!!!
foo(&pTest); // Doesn't work, can't call private operator &
foo(pTest2); // Works, but you can't allocate a new instance of the class