Skip to content

Instantly share code, notes, and snippets.

@Quinny
Last active April 13, 2016 16:00
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 Quinny/ae24316e84abacb55729b56a9ff2c875 to your computer and use it in GitHub Desktop.
Save Quinny/ae24316e84abacb55729b56a9ff2c875 to your computer and use it in GitHub Desktop.
#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