Use lambda and static asserts (since G++ 4.7 is supported).