I have a class like this,
class CLv
{
public:
BOOL operator == (const CLv& lv) const
{
return _value == lv._value && _fStart == lv._fStart;
}
BOOL operator != (const CLv& lv) const
{
return _value != lv._value || _fStart != lv._fStart;
}
BYTE _value;
BYTE _fStart :1;
};
Then, what does the below code segment mean?
CLv lvEnd = {0,0};
It means that the variable
lvEndof typeCLvis initialized with values of0and0for its members_valueand_fStart.Your class is an aggregate:
8.5.1 Aggregates [dcl.init.aggr]
And can be list-initialized:
8.5.4 List-initialization [dcl.init.list]