I know that C++ holds memory management internally with a lot of given points, and I know of the delete command to remove dynamically allocated data, and this question, could seem pointless within the fact that it may not ever come to be an issue due to the destruction of variables outside of the scope of the function that is using them, but is it possible to use a function such like delete to remove a variable that the user is no longer putting to use. Like say that you are on a heavily memory depleted piece of hardware, and need to make sure that even something as small as the 4 bytes that an integer normally takes up are given straight back. Is it possible to do this without wrapping the variable inside some function to make the assembler know to remove it immediately? This is in a sense of a point that I don't believe could ever happen, due to the expansion of memory, and the ways that it could be manipulated these days, but it seems as if it may have been an issue before, if I'm not mistaken.
Summary: Is there a way to manage non dynamic data directly, allocate it to the stack, and remove it from the stack through a function call, or is this completely run by the programs internal instructions?
Example:
void foo(){
short int operator;
/*Did what needed to be done with the operator variable***********/
//Pseudo-code
delete operator;
/*Even though it was not allocated dynamically,
and with the use of another function call*/
}