Skip to content

Instantly share code, notes, and snippets.

@MrSapps
Created July 13, 2015 21:28
Show Gist options
  • Save MrSapps/b6712a7a8d3150804759 to your computer and use it in GitHub Desktop.
Save MrSapps/b6712a7a8d3150804759 to your computer and use it in GitHub Desktop.
#include <memory>
class fool
{
public:
fool(std::unique_ptr<char[]>&& ptr)
: mPtr(std::move(ptr))
{
}
std::unique_ptr<char[]> mPtr;
};
int main(int, char**)
{
std::unique_ptr<char[]> ptr(new char[128]);
fool foo(std::move(ptr));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment