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
Spirit Lex combining token_id's with semantic actions
Thing
Workaround for https://github.com/Project-OSRM/osrm-backend/pull/4385
fun
zero size std::array parameter
Triangle N5
Eight Queen
MSVC_example_fscanf_s_and_chars_wchars
Adaptive return type
Fibonacci stairs