Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef void (*fptr)(void);
- struct Mystruct
- {
- int id;
- int priority;
- double timeSaved;
- double aktivationTime;
- fptr eventPointer;
- MystructnextPtr;
- Mystruct(int id, int priority, double timeSaved, double aktivationTime, fptr eventPointer);
- };
- bool operator <(const Mystruct& x, const Mystruct& y)
- {
- return std::tie(x.aktivationTime, x.priority, x.timeSaved) < std::tie(y.aktivationTime, y.priority, y.timeSaved);
- }
- Mystruct* struct1 = new Mystruct(5, 10, 0, 15.3, f1);
- Mystruct* struct2 = new Mystruct(5, 10, 0, 14.3, fi);
- if (struct1 < struct2)
- {
- cout << "struct1 is smaller!" << endl;
- }
- else
- {
- cout << "struct2 is smaller!" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement