ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Represent/Represent.cpp
(Generate patch)

Comparing Represent/represent.cpp (file contents):
Revision 365 by douglas, 2004-12-21T03:21:00-08:00 vs.
Revision 367 by douglas, 2004-12-21T03:24:26-08:00

# Line 35 | Line 35 | Binary::Binary(std::string& string, bool
35  
36          std::string::size_type index(0);
37  
38 <        _rmforeach (std::vector<char>, byte, bytes)
39 <        {
40 <                _rfor (char, bit, 0, 8)
41 <                {
42 <                        *byte |= (string[index++] == '1') << bit;
43 <                }
44 <        }
38 >        _rmforeach (std::vector<char>, byte, bytes) _rfor (char, bit, 0, 8) *byte |= (string[index++] == '1') << bit;
39   }
40  
41   template <typename Type>
# Line 84 | Line 78 | int main(int argc, char* argv[])
78   {
79          std::string hello("Hello, World!");
80  
81 <        _foreach (std::string, atom, hello)
82 <        {
83 <                std::cout << Binary(*atom) << " = " << *atom << std::endl;
84 <        }
85 <
86 <        _fori (index, -10, 11)
87 <        {
88 <                std::cout << Binary(index) << " = " << index << std::endl;
89 <        }
96 <
97 <        _foru (index, -10, 11)
98 <        {
99 <                std::cout << Binary(index) << " = " << index << std::endl;
100 <        }
101 <
102 <        for (float index(-1.0); index < 1.0; index += 0.1)
103 <        {
104 <                std::cout << Binary(index) << " = " << index << std::endl;
105 <        }
106 <
107 <        for (double index(-1.0); index < 1.0; index += 0.1)
108 <        {
109 <                std::cout << Binary(index) << " = " << index << std::endl;
110 <        }
81 >        _foreach (std::string, atom, hello) std::cout << Binary(*atom) << " = " << *atom << std::endl;
82 >
83 >        _fori (index, -10, 11) std::cout << Binary(index) << " = " << index << std::endl;
84 >
85 >        _foru (index, -10, 11) std::cout << Binary(index) << " = " << index << std::endl;
86 >
87 >        for (float index(-1.0); index < 1.0; index += 0.1) std::cout << Binary(index) << " = " << index << std::endl;
88 >
89 >        for (double index(-1.0); index < 1.0; index += 0.1) std::cout << Binary(index) << " = " << index << std::endl;
90  
91          std::string string("101001101001");
92          Binary binary(string, true);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines