-
-
Save Quinny/ae24316e84abacb55729b56a9ff2c875 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 <cstddef> | |
#include <iostream> | |
template <typename T> | |
struct dyn_array { | |
T* data; | |
dyn_array(std::size_t n): data(new T[n]) {} | |
~dyn_array() { | |
delete[] data; | |
} | |
}; | |
template <typename T> | |
void noop(T x) {} | |
int main() { | |
dyn_array<int> a(100); | |
noop(a); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment