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


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

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


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

示例1:

task4_5::solution::solution( const data_type& data )
{
	if(!data.empty())
	{
		m_max = data[0][0];
		m_min = data[0][0];
		m_current_vector = data.size();
		calculate_result(data);
	}
	else
	{
		m_max = 0;
		m_min = 0;
	}
}
开发者ID:Aljaksandr,项目名称:cpp_craft_1013,代码行数:15,代码来源:solution.cpp

示例2:

task4_5::solution::solution( const data_type& data ) : min_(0), max_(0)
{		
	if (!data.empty())
	{
		data_ = data;

		min_ = std::numeric_limits< int >().max();
		max_ = std::numeric_limits< int >().min();

		cur_it_ = data_.begin();

		boost::thread_group thread_group;
		for(int i = 0; i < 4; ++i)
		{
			thread_group.create_thread(boost::bind(&solution::thread_fun, this));
		}

		thread_group.join_all();
	}
}
开发者ID:Aljaksandr,项目名称:cpp_craft_1013,代码行数:20,代码来源:solution.cpp

示例3: min

task4_5::solution::solution(const data_type& data) : min(std::numeric_limits< int >().max()), max(std::numeric_limits< int >().min())
{
	boost::thread_group threads;

	if (!data.empty())
	{
		for (size_t i = 0; i < data.size(); i++)
		{
			threads.create_thread(boost::bind(&task4_5::solution::search_min, this, boost::ref(data[i])));
			threads.create_thread(boost::bind(&task4_5::solution::search_max, this, boost::ref(data[i])));
		}

		threads.join_all();

	}
	else
	{
		min = 0;
		max = 0;
	}
}
开发者ID:Gedeon-by,项目名称:cpp_craft_0314,代码行数:21,代码来源:solution.cpp

示例4:

task4_5::solution::solution(const data_type& data) : min_(0), max_(0)
{
	std::vector<std::future<std::pair<int, int>>> futures;
	if (data.empty())
	{
		min_ = 0;
		max_ = 0;
	}
	else
	{
		min_ = std::numeric_limits<int>().max();
		max_ = std::numeric_limits<int>().min();
	}
	for (size_t i = 0; i < data.size(); ++i)
		futures.push_back(std::async(&VectMinMaxFindingFunc, std::cref(data[i])));
	for (auto & ftr : futures)
	{
		const auto ftrAns = ftr.get();
		min_ = std::min(min_, ftrAns.first);
		max_ = std::max(max_, ftrAns.second);
	}
}
开发者ID:Eldar322,项目名称:cpp_craft_0314,代码行数:22,代码来源:solution.cpp

示例5: empty

 /// Checks if the container has no elements, i.e. whether
 /// begin() == end().
 bool empty() const
 {
     return partition_vector_.empty();
 }
开发者ID:AntonBikineev,项目名称:hpx,代码行数:6,代码来源:partition_vector_component.hpp

示例6: empty

 /// Checks if the container has no elements, i.e. whether
 /// begin() == end().
 bool empty() const
 {
     return partition_unordered_map_.empty();
 }
开发者ID:dailypips,项目名称:hpx,代码行数:6,代码来源:partition_unordered_map_component.hpp

示例7: empty

 bool empty() const { return data_.empty(); }
开发者ID:naoki-yoshioka,项目名称:pastel,代码行数:1,代码来源:fixed_neighbor_list.hpp


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