本文整理汇总了C++中period类的典型用法代码示例。如果您正苦于以下问题:C++ period类的具体用法?C++ period怎么用?C++ period使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了period类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
inline
bool
period<point_rep,duration_rep>::is_adjacent(const period<point_rep,duration_rep>& other) const
{
return (other.begin() == end() ||
begin_ == other.end());
}
示例2: start
inline
period<point_rep,duration_rep>
period<point_rep,duration_rep>::span(const period<point_rep,duration_rep>& other) const
{
point_rep start((begin_ < other.begin_) ? begin() : other.begin());
point_rep newend((last_ < other.last_) ? other.end() : this->end());
return period<point_rep,duration_rep>(start, newend);
}
示例3:
inline
period<point_rep,duration_rep>
period<point_rep,duration_rep>::intersection(const period<point_rep,duration_rep>& other) const
{
if (begin_ > other.begin_) {
if (last_ <= other.last_) { //case2
return *this;
}
//case 1
return period<point_rep,duration_rep>(begin_, other.end());
}
else {
if (last_ <= other.last_) { //case3
return period<point_rep,duration_rep>(other.begin_, this->end());
}
//case4
return other;
}
//unreachable
}
示例4:
bool operator <= (const period& pe) const {return this->total() <= pe.total();}
示例5: value
/// Allow periods to be compared for equality
bool operator==(const period &p) const {
return this->period<void>::operator==(p) && value() == p.value();
}
示例6: start
/// Allow periods to be compared for equality
bool operator==(const period<void> &p) const {
return start() == p.start() && end() == p.end();
}