Skip to content

Instantly share code, notes, and snippets.

@pervognsen
Created April 19, 2014 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pervognsen/11070807 to your computer and use it in GitHub Desktop.
Save pervognsen/11070807 to your computer and use it in GitHub Desktop.
blah.cpp
template<typename C, typename D, typename... Args>
auto make_resource(C constructor, D destructor, Args&&... args)
{
return std::make_unique_ptr(constructor(std::forward<Args>(args)...), destructor);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment