In your case, using this is not required as an int is [[Plain old data structure|POD]], it has a trivial constructor. If you want to use it, you could use it this way:<source lang="cpp" enclose=div>
for( int i = 0; i < MAX_PIXELS; i++ )
{
int* p = new (buffer+i) int(i) ; // specify where you want the object
v.push_back( p ) ;
cout << "p = " << p << ", *p = " << *p << endl ;
}
</source>
note: Do not call delete for objects allocated using placement new. If they have non-trivial destructors, call the destructor directly (destruction is an operation on an object and therefore can be called!). Release the memory you allocated yourself.