当前位置: 首页>>代码示例>>C++>>正文


C++ intrusive_ptr::reset方法代码示例

本文整理汇总了C++中boost::intrusive_ptr::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ intrusive_ptr::reset方法的具体用法?C++ intrusive_ptr::reset怎么用?C++ intrusive_ptr::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boost::intrusive_ptr的用法示例。


在下文中一共展示了intrusive_ptr::reset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

//typename boost::enable_if<typename intrusive_traits<T>::user_allocator>::type
void
intrusive_make_valid_unique(boost::intrusive_ptr<T> & p)
{
  if (!p)
    p.reset(construct<typename intrusive_traits<T>::user_allocator,T>());
  else if (!p->unique())
    p.reset(intrusive_clone(*p));
}
开发者ID:fullstackenviormentss,项目名称:sbmt,代码行数:9,代码来源:intrusive_refcount.hpp

示例2: load

 inline void load(Archive& ar, boost::intrusive_ptr<T>& t,
     const unsigned int)
 {
     // The most common cause of trapping here would be serializing
     // something like intrusive_ptr<int>.  This occurs because int
     // is never tracked by default.  Wrap int in a trackable type
     BOOST_STATIC_ASSERT((tracking_level<T>::value != track_never));
     T* ptr;
     ar >> ptr;
     t.reset(ptr);
 }
开发者ID:Stevejohntest,项目名称:hpx,代码行数:11,代码来源:serialize_intrusive_ptr.hpp

示例3: intrusive_make_unique

//enable_if ...
void intrusive_make_unique(boost::intrusive_ptr<T> & p)
{
  assert(p);
  if (!p->unique())
    p.reset(intrusive_clone(*p));
}
开发者ID:fullstackenviormentss,项目名称:sbmt,代码行数:7,代码来源:intrusive_refcount.hpp

示例4:

	MyIndexIterForward(const SeqNumIndex* owner) {
		m_index.reset(const_cast<SeqNumIndex*>(owner));
		m_curr = 0;
	}
开发者ID:Strongc,项目名称:nark-db,代码行数:4,代码来源:seq_num_index.cpp


注:本文中的boost::intrusive_ptr::reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。