What are some uses for =delete? [duplicate]
This question already has an answer here : c++ syntax: default and delete modifiers (1 answer) Earlier today I asked a question that led to another one: When should I use =delete ? I don't think there is a post dedicated solely to =delete on SO, so I looked it up in a book called "The C++ Programming Language". I will list my findings in my answer below. Please comment or answer if there's more to say or if I'm mistaken. It turns out that =delete is extremely useful! Here are a few examples: Basically we can prevent copying base classes because it might often lead to slicing: struct Base {