Skip to content

Instantly share code, notes, and snippets.

@jitpaul
Created April 26, 2018 21:24
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 jitpaul/19798224ed3d317cb76e69490511e0cf to your computer and use it in GitHub Desktop.
Save jitpaul/19798224ed3d317cb76e69490511e0cf to your computer and use it in GitHub Desktop.
Smart Pointers
#include <memory>
using namespace std;
int main(){
shared_ptr<int> a(new int(4)); // correct
weak_ptr<int> b = a; //correct
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment