本文整理汇总了C++中set_type类的典型用法代码示例。如果您正苦于以下问题:C++ set_type类的具体用法?C++ set_type怎么用?C++ set_type使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了set_type类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registerDeferredObservers
inline void ObservableSettings::registerDeferredObservers(
const Observable::set_type& observers) {
deferredObservers_.insert(observers.begin(), observers.end());
}
示例2: make_pair
std::pair<iterator, bool>
insert (const value_type& x) {
if (x.first < x.second) {
if (empty ()) {
return m_set.insert (x);
}
iterator pos = find_first_touch (x);
if (pos == end ()) {
//nothing intersects x
return m_set.insert (x);
}
const Key alpha = std::min (x.first, pos->first);
Key beta = pos->second;
while (pos != m_set.end () && touch (*pos, x)) {
beta = pos->second;
m_set.erase (pos++);
}
beta = std::max (beta, x.second);
return m_set.insert (std::make_pair (alpha, beta));
}
return std::make_pair (m_set.end (), false);
}
示例3:
// Let an object register its existence
void
object_registrar::register_object_imp
(
object_id obj
)
{
if ( db_.count(obj) <= 0 )
{
db_.insert( obj );
#if CONTROL_EXTRA_PRINTING
std::cout << "Registered " << obj << '.' << std::endl;
#endif
}
else
{
overeager_.push_back( obj );
#if CONTROL_EXTRA_PRINTING
std::cout << "Attempted to register a non-existant " << obj
<< '.' << std::endl;
#endif
}
}
示例4: clear
//-----------------------------------------------------------------//
void clear() {
erase_set_.clear();
array_.clear();
if(zero_handle_enable_) array_.push_back(T());
}
示例5: unregisterWith
inline
Size Observer::unregisterWith(const ext::shared_ptr<Observable>& h) {
if (h)
h->unregisterObserver(this);
return observables_.erase(h);
}
示例6: Observer
inline Observer::Observer(const Observer& o)
: observables_(o.observables_) {
for (iterator i=observables_.begin(); i!=observables_.end(); ++i)
(*i)->registerObserver(this);
}
示例7: empty
bool empty () const {
return m_set.empty ();
}
示例8: count
size_type count (const key_type& k) const {
return m_set.count (k);
}
示例9: find
iterator find (const key_type& k) const {
return m_set.find (k);
}
示例10: erase
void erase (iterator f, iterator l) {
m_set.erase (f, l);
}
示例11: clear
//-----------------------------------------------------------------//
void clear() {
erase_set_.clear();
current_ = start_;
}
示例12: size
//-----------------------------------------------------------------//
handle_type size() const { return current_ - 1 - erase_set_.size(); }
示例13: size
size_type size () const {
return m_set.size ();
}
示例14: max_size
size_type max_size () const {
return m_set.max_size ();
}
示例15: lower_bound
iterator lower_bound (const key_type& k) const {
return m_set.lower_bound (k);
}