Last active
September 14, 2020 14:29
-
-
Save mikeplavsky/0245b02bc1f9733be4e3e99ae4b15ab5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
auto p = make_unique<int[]>(20); | |
decltype(p) p1; | |
p[7] = 42; | |
p1 = p; | |
cout << p1[7] << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://coliru.stacked-crooked.com/a/147f79fc23cd4f52