I am dealing with Ternary Search Tree and I encountered a different thing in ternary search tree node structure:
struct Node {
char data;
// True if this character is last character of one of the words
unsigned isEndOfString: 1;
struct Node *left, *eq, *right;
};
It is compliled with both C++11 and older versions. I wonder what this unsigned isEndOfString: 1
means? How it is different from bool isEndOfString = true
? What type this statement refers actually and when it is convenient to use such syntax?