| Это на JavaScript встретилось, но часто такое же точно доводилось и, увы, по-прежнему доводится видеть накакписанным и на других языках.
function notZero(somePar) { if(somePar > 0) { return true; } else { return false; } } | комментарии: 23 комментария, оставить комментарий  |
| Есть такая штука:
struct KeyRecordS { KeyRecordS() {}; KeyRecordS(int _Key, byte *_P, size_t _S) : key(_Key), rec(_P, _S) {} int key; CByteRecPtr rec; };
struct KeyRecord { KeyRecord() {}; KeyRecord(const KeyRecord& _Y) { *this = _Y;} KeyRecord& operator=(const KeyRecord& _Y) { m_Rec.key = _Y.m_Rec.key; *m_Rec.rec = _Y.m_Rec.rec.GetRec(); return (*this); } KeyRecordS m_Rec; };
А вот как она используется:
pair<KeyRecord*, KeyRecord*> ind_range; KeyRecord* pFirstIndRec = (KeyRecord*)&*records.begin(); while(pFirstIndRec != (KeyRecord*)&*records.end()) { //... ind_range = equal_range(pFirstIndRec, (KeyRecord*)&*records.end(), *pFirstIndRec, OnlyKeyCompare); //... pFirstIndRec = ind_range.second; }; | комментарии: 3 комментария, оставить комментарий  |
|