You are here |
www.open-std.org | ||
| | | |
www.babaei.net
|
|
| | | | Most of the time I see some C++ programmers who check if a pointer is NULL before deleting it. if (ptr != NULL) { delete ptr; ptr = NULL; } Well, according to C++03 [ISO/IEC IS 14882:2003] ยง5.3.5/2 which explicitly states: ...if the value of the operand of delete is the null pointer the operation has no effect. C++ Standard Core Language Defect Reports and Accepted Issues, Revision 82 delete and user-written deallocation functions Therefore, deleting a NULL pointer has no effect (if the deallocation func... | |
| | | |
danielpecos.com
|
|
| | Function composition is one the key features (among others) of functional programming. Programming languages that offer higher order functions as a feature can potentially use function composition. But, still, programmers need to be aware of some key concepts to successfully apply this pattern in our code. Function composition, as defined on Wikipedia, isan act or mechanism to combine simple functions to build more complicated ones. In other words, we can define new functions, equivalent to the result of... |