Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Multiple inheritance of empty classes - sizeof
#include <iostream> struct A {}; struct B {}; struct C: A, B {}; struct Range: C {float* begin; float* end;}; //static_assert(sizeof(Range)==sizeof(float*)*2, "ERROR"); int main() { std::cout << "sizeof(float*)" << sizeof(float*) << std::endl; std::cout << "sizeof(A) == " << sizeof(A) << std::endl; std::cout << "sizeof(B) == " << sizeof(B) << std::endl; std::cout << "sizeof(C) == " << sizeof(C) << std::endl; std::cout << "sizeof(Range) == " << sizeof(Range) << std::endl; }
run
|
edit
|
history
|
help
0
namespace name resolution
Affine Key Finder and Decrypter
a parameter pack
Hello World
Dequeue Using STL List
Copy double[2][3] into vector<vector<double>>
LinkedList
Arrays
Data structure alignment
cv5