So, I read several answers on Qaru about deleting pointer arguments, especially these ( 1 , 2 ), because I'm building a function that needs a pointer as an argument.
A simplified version of the function is below:
void draw(Shape * b)
{
}
No, what confuses me is removal. For example, if a function is called like this:
Shape * c;
draw(&c);
Then I do not need to delete anything. But if so:
draw(new Shape{});
. , : , new. , , RAII. ? , , , , , . , , , , , , , . , : , .