Sometimes it can be an annoyance that c++ defaults to allow slicing. For example 

```
struct foo { int a; };
struct bar : foo { int b; };

int main() {
    bar x{1,2};
    foo y = x; // <- I dont want this to compile!
}

```

This [compiles and runs as expected](https://wandbox.org/permlink/AvO1QloBrTPe0tbp)! Though, what if I dont want to enable slicing?

What is the idiomatic way to write `foo` such that one cannot slice instances of any derived class?