Created
January 11, 2013 15:35
-
-
Save DennisOSRM/4511565 to your computer and use it in GitHub Desktop.
Packing is dependent on the order of things
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <boost/integer.hpp> | |
typedef uint32_t NodeID; | |
struct EdgeData1 { | |
unsigned id:31; | |
bool shortcut:1; | |
int distance:30; | |
bool forward:1; | |
bool backward:1; | |
}; | |
struct EdgeData2 { | |
unsigned id:31; | |
int distance:30; | |
bool shortcut:1; | |
bool forward:1; | |
bool backward:1; | |
}; | |
int main(int argc, char * argv[]) { | |
std::cout << "size: " << sizeof(EdgeData1) << std::endl; | |
std::cout << "size: " << sizeof(EdgeData2) << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment