Skip to content

Instantly share code, notes, and snippets.

Created January 19, 2013 02:15
Show Gist options
  • Save anonymous/4570285 to your computer and use it in GitHub Desktop.
Save anonymous/4570285 to your computer and use it in GitHub Desktop.
/tmp/x.cxx
#include <array>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
template<typename C>
void test()
{
C c{42, 42, 42};
cout << &c << "+" << sizeof(c) << endl;
for (auto &e : c) {
cout << " " << &e << "+" << sizeof(e) << endl;
}
}
int main()
{
test<vector<int>>();
//test<array<int, 3>>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment