10 |
|
|
11 |
|
#include <foreach.hpp> |
12 |
|
|
13 |
– |
/*template <typename Type> |
14 |
– |
std::string binary(const Type& type) |
15 |
– |
{ |
16 |
– |
std::ostringstream string; |
17 |
– |
|
18 |
– |
_rforu (index, 0, 8 * sizeof (type)) |
19 |
– |
{ |
20 |
– |
bool bit(1 & type >> index); |
21 |
– |
|
22 |
– |
string << bit; |
23 |
– |
} |
24 |
– |
|
25 |
– |
return string.str(); |
26 |
– |
}*/ |
27 |
– |
|
13 |
|
class Binary |
14 |
|
{ |
15 |
|
private: |
68 |
|
std::cout << Binary(index) << " = " << index << std::endl; |
69 |
|
} |
70 |
|
|
71 |
< |
_foru (index, -10, 11) |
71 |
> |
_foru (index, 4294967286, 11) |
72 |
|
{ |
73 |
|
std::cout << Binary(index) << " = " << index << std::endl; |
74 |
|
} |