What does (1U

It sets bitmasks:

1U << 0 = 1
1U << 1 = 2
1U << 2 = 4
etc...

What happens is 1U (unsigned value 1) is shifted to the left by x bits.

The code you posted is equivalent to:

enum 
{
      IsDynamic = 1U,  // binary: 00000000000000000000000000000001
      IsSharable = 2U, // binary: 00000000000000000000000000000010
      IsStrong = 4U    // binary: 00000000000000000000000000000100
}

Leave a Comment