inline uint32_t code(uint32_t reg, Writer &writer)
{
uint32_t ZIEL, LHS, RHS;
if(op == OP_CONJ) {
LHS = lhs->code(reg, writer);
RHS = rhs->code(LHS + 1, writer);
reg = RHS + 1;
writer << OP_CONJ << reg << LHS << RHS;
...
有人可能會幫我理解什麼「< <」呢?C++:這個符號「<<」做什麼?
這裏是Writer
結構:
struct Writer {
std::ostream &os;
inline Writer(std::ostream &_os) : os(_os) { } inline Writer &operator<<(uint32_t val) {
os.write((const char*)&val, sizeof(uint32_t));
return *this;
}
這可能有所幫助:http://www.cplusplus.com/doc/tutorial/basic_io/ – jasonszhao