This seems to work but is it right?

template <typename T>
inline void UnSetBit(T &var, byte ind)
{
var &= ~(1 << ind);
}