language: C++ 4.7.2 (gcc-4.7.2)
date: 366 days 22 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <cstddef>
#include <cassert>
 
template<int size>
class Padding {
    char padding[size];
};
//User can't do _anything_ with this type
//except make it, copy it, and destruct it.
 
struct Name {
    long Id;
    Padding<32> padding; 
    float X;
};
 
int main() {
  assert(sizeof(int) == 4);
  assert(sizeof(long) == 4);
  assert(sizeof(float) == 4);
  assert(offsetof(Name, Id) == 0);
  assert(offsetof(Name, X) == 0x24);
    Name a;
}