In this case it is safe because you're going from something that can be modified to a const context. It is the vice versa situation that can be unsafe, e.g., because it could lead to an attempt to modify a string constant.
In this case it is safe because you're going from something that can be modified to a const context. It is the vice versa situation that can be unsafe, e.g., because it could lead to an attempt to modify a string constant.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)