Skip to content

Instantly share code, notes, and snippets.

@acmorrow
Created February 5, 2013 20:00
Show Gist options
  • Save acmorrow/4717154 to your computer and use it in GitHub Desktop.
Save acmorrow/4717154 to your computer and use it in GitHub Desktop.
// In C++11, we can ask for the size of a type for which we don't have an instance:
class Tcp6Socket {
public:
struct SockAddr { ... };
};
char buf[1024];
static_assert(sizeof(buf) >= sizeof(Tcp6Socket::SockAddr));
// Can't do that in C++03, but it works in C++11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment