jeudi 10 septembre 2020

what does : means in variable declaration in c++ [duplicate]

I found this code in one of the header file

struct OSMNode {
  // The osm id of the node
  uint64_t osmid_;

  // Store node names in a separate list (so they don't require as many indexes)
  uint64_t name_index_ : 21;
  uint64_t ref_index_ : 21;
  uint64_t exit_to_index_ : 21;
  uint64_t named_intersection_ : 1;

  uint32_t access_ : 12;
  uint32_t type_ : 4;
  uint32_t intersection_ : 1;
  uint32_t traffic_signal_ : 1;
  uint32_t forward_signal_ : 1;
  uint32_t backward_signal_ : 1;
  uint32_t non_link_edge_ : 1;
  uint32_t link_edge_ : 1;
  uint32_t shortlink_ : 1; // Link edge < kMaxInternalLength
  uint32_t non_ferry_edge_ : 1;
  uint32_t ferry_edge_ : 1;
  uint32_t flat_loop_ : 1; // A node which on a section of a way that is doubled back on itself
  uint32_t urban_ : 1;
  uint32_t spare_ : 5;

can you tell me what does : means in variable declaration like in uint32_t spare_ : 5;

Aucun commentaire:

Enregistrer un commentaire