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


C++ data_type::clear方法代码示例

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


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

示例1: load_data

void session_interface::load_data(data_type &data,std::string const &s)
{
	data.clear();
	char const *begin=s.data(),*end=begin+s.size();
	while(begin < end) {
		packed p(begin,end);
		begin +=sizeof(p);
		if(end - begin >= int(p.key_size + p.data_size)) {
			string key(begin,begin+p.key_size);
			begin+=p.key_size;
			string val(begin,begin+p.data_size);
			begin+=p.data_size;
			entry &ent=data[key];
			ent.exposed = p.exposed;
			ent.value.swap(val);
		}
		else {
			throw cppcms_error("sessions::format violation data");
		}

	}

}
开发者ID:klupek,项目名称:cppcms,代码行数:23,代码来源:session_interface.cpp

示例2: clear

 /** @brief Remove all elements from the vector leaving the
     *          partition_vector with size 0.
     */
 void clear()
 {
     partition_vector_.clear();
 }
开发者ID:AntonBikineev,项目名称:hpx,代码行数:7,代码来源:partition_vector_component.hpp

示例3: initialize

 void initialize(size_t s, const char* name)
 {
   _data.clear();
   this->reserve(s);
   _outgoing<<'{'<<"jsonrpc"<<':'<<"2.0"<<','<<"method"<<':'<<name<<','<<"params"<<':';
 }
开发者ID:ApelSYN,项目名称:leveldb-daemon,代码行数:6,代码来源:ad_outgoing_object.hpp

示例4: clear

 void clear(T&)
 {
   _data.clear();
 }
开发者ID:ApelSYN,项目名称:leveldb-daemon,代码行数:4,代码来源:ad_outgoing_object.hpp

示例5: clear

 /// Remove all elements from the vector leaving the
 /// partitioned_vector_partition with size 0.
 ///
 void clear()
 {
     partitioned_vector_partition_.clear();
 }
开发者ID:Quanteek,项目名称:hpx,代码行数:7,代码来源:partitioned_vector_component.hpp

示例6: clear

 /// Remove all elements from the vector leaving the
 /// partition_unordered_map with size 0.
 ///
 void clear()
 {
     partition_unordered_map_.clear();
 }
开发者ID:dailypips,项目名称:hpx,代码行数:7,代码来源:partition_unordered_map_component.hpp


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