Hi,
We have a class that has its own overloaded operator new and whose
prototype seems to correspond to the standard placement new :-
class AppClass
{
public:
operator new (size_t size, void *ctx)
......
}
The ctx is important for us. Now we find that if we have a
vector<AppClassinstance, when the vector is resized, our overloaded
operator new is called!. Here is the comment from the STL vector
implementation :-
template<class _T1,
class _T2inline
void _Construct(_T1 _FARQ *_Ptr, const _T2& _Val)
{ // construct object at _Ptr with value _Val
new ((void _FARQ *)_Ptr) _T1(_Val);
}
Is this documented somewhere in the standard? Or should we have
chosen our operator new's signature more carefully? Can I do some easy
thing to get around this issue?
Thanks in advance,
anu.