Search

Sponsored Links

Meta

Categories

Archives

Recent Posts

RSS Feeds

08
Dec

How is “const correctness” related to ordinary type safety?

Related Blog Items

Declaring the const-ness of a parameter is just another form of type safety. It is almost as if a const std::string, for example, is a different class than an ordinary std::string, since the const variant is missing the various mutative operations in the non-const variant (e.g., you can imagine that a const std::string simply doesn’t have an assignment operator).

If you find ordinary type safety helps you get systems correct (it does; especially in large systems), you’ll find const correctness helps also.

source: usenet

Popularity: 3%

You need to log on to convert this article into PDF


Related Blog Items

No Comments

No comments yet.

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image