本文整理汇总了C++中range_t::end方法的典型用法代码示例。如果您正苦于以下问题:C++ range_t::end方法的具体用法?C++ range_t::end怎么用?C++ range_t::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类range_t
的用法示例。
在下文中一共展示了range_t::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
void operator()( const range_t& r ) {
count_t end = r.end();
volatile count_t anchor = 0;
for( count_t i = r.begin(); i < end; ++i )
anchor += i;
my_sum = anchor;
}
示例2: operator
void operator()(const range_t& range) const {
util::rng the_rng(range.begin());
const size_t i_end = range.end();
size_t count = 0, j = 0;
point_t tmp_vec[grainSize];
for(size_t i=range.begin(); i!=i_end; ++i) {
tmp_vec[j++] = util::GenerateRNDPoint<double>(count,the_rng,util::rng::max_rand);
}
#if USECONCVEC
grow_vector_to_at_least(points,range.end());
#else // USE STD::VECTOR
grow_vector_to_at_least(insertMutex,points,range.end());
#endif // USECONCVEC
std::copy(tmp_vec, tmp_vec+j,points.begin()+range.begin());
}
示例3: operator
void operator()(const range_t& range) const {
util::rng the_rng(range.begin());
const size_t i_end = range.end();
size_t count = 0, j = 0;
point_t tmp_vec[grainSize];
for(size_t i=range.begin(); i!=i_end; ++i) {
tmp_vec[j++] = util::GenerateRNDPoint<double>(count, the_rng, util::rng::max_rand);
}
//Here we have race condition. Elements being written to may be still under construction.
//For C++ 2003 it is workarounded by vector element type which default constructor does not touch memory,
//it being constructed on. See comments near default ctor of point class for more details.
//Strictly speaking it is UB.
//TODO: need to find more reliable/correct way
points.grow_to_at_least(range.end());
std::copy(tmp_vec, tmp_vec+j,points.begin()+range.begin());
}
示例4: run
void run ( const range_t& r, Partitioner& p ) const {
count_t end = r.end();
if ( my_depth > 1 )
for ( count_t i = r.begin(); i < end; ++i )
tbb::parallel_for( range_t(0, IterRange, IterGrain), NestingForBody(my_depth - 1), p );
else
for ( count_t i = r.begin(); i < end; ++i )
tbb::parallel_for( range_t(0, IterRange, IterGrain), SimpleForBody(), p );
}