本文整理汇总了C++中std::deque::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ deque::begin方法的具体用法?C++ deque::begin怎么用?C++ deque::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::deque
的用法示例。
在下文中一共展示了deque::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prefetchOps
// Doles out all the work to the reader pool threads and waits for them to complete
void SyncTail::prefetchOps(const std::deque<BSONObj>& ops) {
for (std::deque<BSONObj>::const_iterator it = ops.begin();
it != ops.end();
++it) {
_prefetcherPool.schedule(&prefetchOp, *it);
}
_prefetcherPool.join();
}
示例2: insertCoordinates
void MultipolygonProcessor::insertCoordinates(const std::deque<GeoCoordinate>& source, std::vector<GeoCoordinate>& destination, bool isOuter) const
{
bool isClockwise = utymap::utils::isClockwise(source);
if ((isOuter && isClockwise) || (!isOuter && !isClockwise))
destination.insert(destination.end(), source.begin(), source.end());
else
destination.insert(destination.end(), source.rbegin(), source.rend());
}
示例3: setup_players
void setup_players(std::deque<player_t *> &tournament_players) {
tournament_players.assign(this->players.begin(), this->players.end());
std::random_shuffle(tournament_players.begin(), tournament_players.end());
/** Define o 1o elemento como "bye", se necessário" */
if(tournament_players.size() % 2)
tournament_players.push_front(nullptr);
}
示例4: deactive
bool deactive(thread_control_block *tcb){
threads.erase(std::find(threads.begin(), threads.end(), tcb));
threads.push_back(tcb);
sem_post(&service_count);
int v;
sem_getvalue(&service_count, &v);
return true;
}
示例5: toString
static std::string toString(const std::deque<T>& iVector) {
typename std::vector<T>::const_iterator it = iVector.begin();
std::stringstream ss;
for(;it!=iVector.end();++it) {
ss << (*it);
}
return ss.str();
}
示例6: getTracePoints
std::vector<cv::Point> getTracePoints() {
std::vector<cv::Point> ret;
for (std::deque<TraceEntry*>::iterator it = trace.begin(); it != trace.end(); it++) {
TraceEntry * entry = *it;
ret.push_back(entry->point);
}
return ret;
}
示例7: contains
bool contains(std::deque<int>& memory, int i){
for(auto it=memory.begin(); it!=memory.end();++it){
if(*it == i){
return true;
}
}
return false;
}
示例8:
void load_player(std::deque<G_obj*> &map, std::fstream &my_file)
{
G_obj m_object;
recup_base(&m_object, my_file);
map.push_back(&m_object);
for_each(map.begin(), map.end(), test_map);
}
示例9: printLeaves
// Print the leaves only (just for the bottom row)
void printLeaves(int indentSpace, int level, int nodesInThisLevel, const std::deque<Node*>& nodesQueue, std::ostream& out) {
std::deque<Node*>::const_iterator iter = nodesQueue.begin();
for (int i = 0; i < nodesInThisLevel; i++, iter++) {
out << ((i == 0) ? std::setw(indentSpace + 2) : std::setw(2 * level + 2)) << ((*iter) ? std::to_string((*iter)->data) : \
"");
}
out << std::endl;
}
示例10: remove
bool remove(std::deque<RHNode> &vec, RHNode &element)
{
std::deque<RHNode>::iterator it = std::find(vec.begin(), vec.end(), element);
if(it == vec.end())
return true;
vec.erase(it);
return true;
}
示例11: translateBlock
static void translateBlock(std::deque<llvm::MCInst>& block) {
typedef std::map<std::string, LLVMValueRef>::const_iterator ValRef;
std::map<std::string, LLVMValueRef> locals;
std::map<std::string, LLVMValueRef> regs;
for (InstIter it = block.begin(); it != block.end(); ++it) {
llvm::MCInst& inst = *it;
const llvm::MCInstrDesc& id = MII->get(inst.getOpcode());
llvm::StringRef iname = MII->getName(inst.getOpcode());
if (iname.startswith("MOV")) {
LLVMValueRef lhs;
unsigned iop = 0;
if (id.OpInfo[0].OperandType == llvm::MCOI::OPERAND_MEMORY) {
std::string localName = getLocalName(inst, 0);
ValRef pval = locals.find(localName);
if (pval == locals.end()) {
lhs = LLVMBuildAlloca(llvmBuilder, LLVMInt32Type(), localName.c_str());
locals[localName] = lhs;
} else {
lhs = pval->second;
}
if (id.OpInfo[5].OperandType == llvm::MCOI::OPERAND_IMMEDIATE) {
const llvm::MCOperand& op = inst.getOperand(5);
LLVMBuildStore(llvmBuilder, lhs, LLVMConstInt(LLVMInt32Type(), op.getImm(), 0));
}
if (id.OpInfo[5].OperandType == llvm::MCOI::OPERAND_REGISTER) {
LLVMBuildStore(llvmBuilder, lhs, regs[getRegName(inst, 5)]);
}
} else if (id.OpInfo[0].OperandType == llvm::MCOI::OPERAND_REGISTER) {
LLVMValueRef rhs;
printInst(inst);
if (id.OpInfo[1].OperandType == llvm::MCOI::OPERAND_IMMEDIATE) {
rhs = LLVMConstInt(LLVMInt32Type(), inst.getOperand(1).getImm(), 0);
} else if (id.OpInfo[1].OperandType == llvm::MCOI::OPERAND_MEMORY) {
ValRef pval = locals.find(getLocalName(inst, 1));
if (pval == locals.end()) {
llvm::outs() << "No such local " << getLocalName(inst, 1) << "\n";
break;
}
rhs = LLVMBuildLoad(llvmBuilder, pval->second, getRegName(inst, 0));
} else {
continue;
}
regs[getRegName(inst, 0)] = rhs;
}
}
}
}
示例12: OnShow
void OnShow()
{
for( cIter c=children.begin(); c!=children.end(); ++c)
{
GDLWidget* w = GetWidget( *c);
if( w != NULL)
w->OnShow();
}
}
示例13: computeAverage
float GoalieSystem::computeAverage(std::deque<float> q)
{
float sum = 0;
for(std::deque<float>::iterator i = q.begin(); i != q.end(); i++)
{
sum += *i;
}
return sum / float(q.size());
}
示例14: maxOffsetOf
/**
* \details Compute the largest offset from a deque of tasks
* \return this offset
*/
int Simulation::maxOffsetOf(std::deque<Task> tasks)
{
int maxOffset = 0;
for (deque<Task>::iterator it = tasks.begin(); it != tasks.end(); ++it)
{
maxOffset = max(maxOffset, (*it).getOffset());
}
return maxOffset;
}
示例15: remove_symbol
///Method to remove a symbol
bool remove_symbol(const char* symbol_name) {
for( typename std::deque<std::pair<std::string, T> >::iterator it = symbols.begin() ; it != symbols.end() ; it++ ){
if( it->first.compare(symbol_name) == 0 ){
symbols.erase(it);
return true;
}
}
return false;
}