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
PTaHHHa
What exactly is “broken” with Microsoft Visual C++'s two-phase template instantiation?
Code
additional layer of indirection
1
regex select, find
timeConversion
Hello World
C string literal
throwing Copyable versus throwing MoveOnly