Bad practice to return unique_ptr for raw pointer like ownership semantics?

Returning a std::unique_ptr from a factory method is just fine and should be a recommended practice. The message it conveys is (IMO): You are now the sole owner of this object. Furthermore, for your convenience, the object knows how to destroy itself. I think this is much better then returning a raw pointer (where the … Read more

Smart pointers: who owns the object? [closed]

Simple C++ Model In most modules I saw, by default, it was assumed that receiving pointers was not receiving ownership. In fact, functions/methods abandoning ownership of a pointer were both very rare and explicitly expressed that fact in their documentation. This model assumes that the user is owner only of what he/she explicitly allocates. Everything … Read more

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