Meaning of = delete after function declaration

Deleting a function is a C++11 feature: The common idiom of “prohibiting copying” can now be expressed directly: class X { // … X& operator=(const X&) = delete; // Disallow copying X(const X&) = delete; }; […] The “delete” mechanism can be used for any function. For example, we can eliminate an undesired conversion like … Read more

Is it safe to delete a NULL pointer?

delete performs the check anyway, so checking it on your side adds overhead and looks uglier. A very good practice is setting the pointer to NULL after delete (helps avoiding double deletion and other similar memory corruption problems). I’d also love if delete by default was setting the parameter to NULL like in #define my_delete(x) … Read more

Deleting array elements in JavaScript – delete vs splice

delete will delete the object property, but will not reindex the array or update its length. This makes it appears as if it is undefined: > myArray = [‘a’, ‘b’, ‘c’, ‘d’] [“a”, “b”, “c”, “d”] > delete myArray[0] true > myArray[0] undefined Note that it is not in fact set to the value undefined, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)