typedef struct min_index
{
using uint8 = typename unsigned char;
uint8 _val : 2; // 内部数据占用2字节空间
min_index()
: _val(0) {}
min_index(uint8 val)
: _val(val) {}
// 重载数据类型
operator uint8()
{ return _val; }
operator bool()
{ return _val; }
min_index &operator=(uint8 val)
{ _val = val; }
// 重载 == 和 !=
bool operator==(uint8 val)
{ return _val == val; }
bool operator!=(uint8 val)
{ return _val != val; }
// 重载后置++
min_index operator++(int)
{ ++_val; return _val; }
// 重载前置++
min_index &operator++()
{ ++_val; return *this; }
// 重载后置--
min_index operator--(int)
{ --_val; return _val; }
// 重载前置--
min_index &operator--()
{ --_val; return *this; }
}min_index;