summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/post.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/post.h b/src/post.h
index cea1aca1..3a8c5541 100644
--- a/src/post.h
+++ b/src/post.h
@@ -199,6 +199,20 @@ public:
friend class xact_t;
+ struct compare_by_date_and_sequence
+ {
+ bool operator()(const post_t * left, const post_t * right) const {
+ gregorian::date_duration duration =
+ left->actual_date() - right->actual_date();
+ if (duration.days() == 0) {
+ return ((left->pos ? left->pos->sequence : 0) <
+ (right->pos ? right->pos->sequence : 0));
+ } else {
+ return duration.days() < 0;
+ }
+ }
+ };
+
#if defined(HAVE_BOOST_SERIALIZATION)
private:
/** Serialization. */