During a recent discussion (see comments to this answer), R.. recommended to never create aliases for pointer-to-const
types as you won\'t be able to deallocat
If you return a const
-qualified pointer, the semantics are that the caller of your function is not permitted to modify the object in any way. That includes freeing it, or passing it to any function in your library that would in turn free it. Yes I'm aware that you could cast away the const
qualifier, but then you're breaking the contract that const
implies.