Name: Anonymous 2014-07-22 13:29
Can be yours or not, I just want to see something good.
bitptr bitptr::operator+(int j) const {
bitptr val{ *this };
val += j;
return val;
}
bitptr bitptr::operator-(int j) const {
bitptr val{ *this };
val -= j;
return val;
}
bitref bitptr::operator[](int j) const {
return *(*this + j);
};
char s = "Hello world";
bitptr p{static_cast<void*>(s)};
for(int i = 0; i < 11*CHAR_BIT; i++)
std::cout << p[i] ? "1" : "0";
std::cout << std::endl;