No, it’s not guaranteed and an implementation may legitimately assign zero to an lvalue operand to delete
.
Bjarne Stroustrup had hoped that implementations would choose to do this, but not many do.
More Related Contents:
- C++ delete – It deletes my objects but I can still access the data?
- Is it safe to delete a NULL pointer?
- How does delete[] know it’s an array?
- Is there any reason to check for a NULL pointer before deleting?
- Deleting a pointer in C++
- What happens when you deallocate a pointer twice or more in C++?
- What is the difference between '.' and '->' when used in array? [closed]
- ifstream* Segmentation fault [closed]
- A short C++ program about the pointer
- Is `&variable = null;` possible? [closed]
- C++ Memory Leak Using char *
- What are the differences between a pointer variable and a reference variable in C++?
- When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?
- How to access a local variable from a different function using pointers?
- Typedef function pointer?
- Why isn’t it legal to convert “pointer to pointer to non-const” to a “pointer to pointer to const”
- Correct way of declaring pointer variables in C/C++ [closed]
- Reason to Pass a Pointer by Reference in C++?
- Uses for multiple levels of pointer dereferences?
- Why dereferencing a null pointer is undefined behaviour?
- Deleting a pointer to const (T const*)
- overloading new/delete
- Is a pointer with the right address and type still always a valid pointer since C++17?
- Constexpr pointer value
- Does accessing a declared non-volatile object through a volatile reference/pointer confer volatile rules upon said accesses?
- Is pointer comparison undefined or unspecified behavior in C++?
- Why I can access member functions even after the object was deleted?
- What is the uintptr_t data type?
- How does the custom deleter of std::unique_ptr work?
- Why am I able to make a function call using an invalid class pointer