logoalt Hacker News

mgaunardlast Monday at 11:35 AM1 replyview on HN

For pointers, const only affects whether you can re-set it to point to something else, not the pointee.

Nothing prevents you from building a smart pointer with those semantics though, std::indirect is an example of this (arguably closer to Rust's Box).


Replies

wtetznerlast Tuesday at 12:50 AM

Sure, but my point is that the semantics between C++ and Rust are different, and are therefore not an exact match as the article stated.

show 1 reply