Horizon Posted December 31, 2024 Share Posted December 31, 2024 The topic of this post is to show different ways to ensure that a class is either non-moveable or non-copyable. How to Ensure a Class is not Copyable or Movable by Sandor Dargo From the article: If we follow the classification proposed by Sebastian Theophil, we can talk about 4 different class types: value classes container classes resource classes singleton classes While the first two should be regular classes offering both copy and move semantics, the latter two are different. One shouldn’t be able to copy resources and singletons probably shouldn’t be moveable. It’s up to us to ensure that a class we create implements the right special member functions (SMFs from now on). And the Hinnant table is here to guide us. View the full article Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.