Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eliminate size overhead for compile time dimensions #5

Closed
bebuch opened this issue Sep 2, 2016 · 1 comment
Closed

eliminate size overhead for compile time dimensions #5

bebuch opened this issue Sep 2, 2016 · 1 comment

Comments

@bebuch
Copy link
Owner

bebuch commented Sep 2, 2016

#include <iostream>

struct A{};
struct B{};

struct dim: private A, private B{};

struct C: dim{ int v; };

int main(){
    std::cout << sizeof(A) << std::endl;
    std::cout << sizeof(B) << std::endl;
    std::cout << sizeof(dim) << std::endl;
    std::cout << sizeof(C) << std::endl;
}

Output:
1
1
1
4

@bebuch
Copy link
Owner Author

bebuch commented Sep 2, 2016

done with commit 041623a

@bebuch bebuch closed this as completed Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant