Quantcast
Channel: Move constructor involving const unique_ptr - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by user3920237 for Move constructor involving const unique_ptr

$
0
0

If you want to prevent transfer of ownership, you can use a const std::unique_ptr<T>. This is not very useful.

If you want to prevent modifying the object it holds, you can use a std::unique_ptr<const T>.


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>