Skip to content

Instantly share code, notes, and snippets.

@njlr
Created May 25, 2017 14:01
Show Gist options
  • Save njlr/a4dd36461f9272cf12333c2524a3c4ed to your computer and use it in GitHub Desktop.
Save njlr/a4dd36461f9272cf12333c2524a3c4ed to your computer and use it in GitHub Desktop.
struct Foo {
int bar() {
return ptr->bar();
}
Foo(int x);
// Thanks to value_ptr we get value semantics for free
Foo(Foo const&) = default;
Foo& operator=(Foo const&) = default;
~Foo() = default;
struct Pimpl;
value_ptr<Pimpl> ptr;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment