change merge_inclusive to hull

[SVN r19662]
This commit is contained in:
Jeff Garland
2003-08-17 16:08:37 +00:00
parent f9e4b0b66d
commit f57e968395
2 changed files with 12 additions and 21 deletions

View File

@@ -80,7 +80,7 @@ namespace date_time {
bool is_after(const point_rep& point) const;
period intersection(const period& other) const;
period merge(const period& other) const;
period merge_inclusive(const period& other) const;
period hull(const period& other) const;
private:
point_rep begin_;
point_rep last_;
@@ -320,7 +320,7 @@ namespace date_time {
return period<point_rep,duration_rep>(begin_,begin_); // no intersect return null
}
//! Same as merge for intersecting periods, inclusive merge otherwise.
//! Combine two periods with earliest start and latest end.
/*! Combines two periods and any gap between them such that
* start = min(p1.start, p2.start)
* end = max(p1.end , p2.end)
@@ -334,12 +334,11 @@ namespace date_time {
template<class point_rep, class duration_rep>
inline
period<point_rep,duration_rep>
period<point_rep,duration_rep>::merge_inclusive(const period<point_rep,duration_rep>& other) const
period<point_rep,duration_rep>::hull(const period<point_rep,duration_rep>& other) const
{
point_rep start = min(begin_, other.begin_);
point_rep last = max(end(), other.end());
return period<point_rep,duration_rep>(start, last);
}