本文整理汇总了C++中value_type::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ value_type::empty方法的具体用法?C++ value_type::empty怎么用?C++ value_type::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类value_type
的用法示例。
在下文中一共展示了value_type::empty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void separate_interval_set<DomainT,Interval,Compare,Alloc>::insert(const value_type& x)
{
if(x.empty()) return;
std::pair<typename ImplSetT::iterator,bool> insertion = this->_set.insert(x);
if(insertion.WAS_SUCCESSFUL)
handle_neighbours(insertion.ITERATOR);
else
{
typename ImplSetT::iterator fst_it = this->_set.lower_bound(x);
typename ImplSetT::iterator end_it = this->_set.upper_bound(x);
typename ImplSetT::iterator it=fst_it, nxt_it=fst_it, victim;
Interval<DomainT> leftResid; (*it).left_surplus(leftResid,x);
Interval<DomainT> rightResid;
while(it!=end_it)
{
if((++nxt_it)==end_it)
(*it).right_surplus(rightResid,x);
victim = it; it++; this->_set.erase(victim);
}
Interval<DomainT> extended = x;
extended.extend(leftResid).extend(rightResid);
extended.extend(rightResid);
insert(extended);
}
}
示例2: operator
//! Formatting operator
result_type operator() (stream_type& strm, value_type const& scopes) const
{
if (!scopes.empty())
{
if (m_direction == expressions::forward)
format_forward(strm, scopes);
else
format_reverse(strm, scopes);
}
else
{
strm << m_empty_marker;
}
}
示例3: then_else
bool parameters::then_else( bool expr, value_type const &s,
value_type::size_type *pos,
value_type *replacement ) const {
value_type::value_type c = s[ *pos ];
bool found_param = false, not_empty = false;
switch ( c ) {
case_123456789:
found_param = true;
if ( expr ) {
*replacement = lookup_param( to_index( c ) );
not_empty = !replacement->empty();
}
break;
case '{':
while ( ++*pos < s.size() ) {
c = s[ *pos ];
switch ( c ) {
case_123456789:
found_param = true;
if ( expr ) {
value_type const param = lookup_param( to_index( c ) );
not_empty = !param.empty() || not_empty;
*replacement += param;
}
break;
case '}':
goto done;
case '\\':
if ( *pos + 1 < s.size() )
c = s[ ++*pos ];
// no break;
default:
if ( expr )
*replacement += c;
} // switch
} // while
throw invalid_argument( "'}' expected for ?:" );
default:
throw invalid_argument(
BUILD_STRING(
'\'', c, "': invalid character after '", (expr ? '?' : ':'),
"' (one of [1-9{] expected)"
)
);
} // switch
done:
return !found_param || not_empty;
}
示例4: IsEmpty
bool IsEmpty() const {
return value.empty();
}
示例5:
static typename boost::disable_if<Clearable>::type
fork_clear_check(value_type const& value) {
if (value.empty())
throw(restricted_string_nonconformance("空に変更できません"));
}
示例6: conform_check
static void conform_check(value_type const& value) {
if (!value.empty() && !is_conform(value))
throw(restricted_string_nonconformance("制限に適合しません"));
}
示例7: empty
bool empty() const {
return value_.empty();
}