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


C++ vs::begin方法代码示例

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


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

示例1: toString

	//debugging purpose
	void toString(){
		cerr << "Call name: " << call_fun_name << " | Functions: ";
		for(vs::iterator i = function_uses.begin(); i != function_uses.end(); i++){
			cerr << *i << " ";
		}
		cerr << "| Pairs Size " << pairs.size() << endl;
	}
开发者ID:killmyrene,项目名称:pipair,代码行数:8,代码来源:pipair.cpp

示例2: containsElem

//----------------------------------------------------------------------------
// Returns true if a given vector<string> contains given string
//----------------------------------------------------------------------------
bool containsElem(vs list, string value) {
	for (vs::iterator it = list.begin(); it != list.end(); it++) {
		if (*it == value) {
			return true;
		}
	}
	return false;
}
开发者ID:killmyrene,项目名称:pipair,代码行数:11,代码来源:pipair.cpp

示例3: newMemberTwo

string newMemberTwo(vs existingNames, string newName)
{
	set<string> names(existingNames.begin(), existingNames.end());

	if(names.count(newName) == 0 )
		return newName;

	char testName[1024];
	int currentInt = 1;

	while(1)
	{

		sprintf(testName, "%s%d", newName.c_str(), currentInt);

		if(names.count(testName) == 0)
			return testName;
		else
			currentInt++;
	}
}
开发者ID:rusty34,项目名称:TopCoder,代码行数:21,代码来源:UserName.cpp

示例4: foo

void foo(const vs &lines)
{
    for (vs::const_iterator i(lines.begin()); i != lines.end(); ++i) {
        cout << **i << endl;
    }
}
开发者ID:nodakai,项目名称:exp,代码行数:6,代码来源:const_iterator.cpp

示例5: newMember

string newMember(vs existingNames, string newName)
{

	bool match = true;
	int newSize = newName.size();
	vector<int> numberList;

	for(vs::iterator it = existingNames.begin(); it != existingNames.end(); it++)
	{
		match = true;
		int stringSize = it->size();

		if(stringSize >= newSize)
		{
			for(int i = 0; i < newSize; i++)
			{
				if(it->at(i) != newName[i])
				{
					match = false;
					//cout << "Match not found\n";
					break;
				}
			}

			if(match)
			{
				//FoundString
				//Number at end
				int numberInt;
				if(stringSize == newSize)
				{
					numberInt = 0;
				}
				else
				{
					string number = it->substr(newSize, stringSize-1);
					numberInt = atoi(number.c_str());
				}

				numberList.push_back(numberInt);

				//cout << "Match found - int = " << numberInt << "\n";
			}
		}
		else
		{
			//cout << "Match not found\n";
		}

	}

	if(!numberList.empty())
	{
		sort(numberList.begin(), numberList.end());

		int lowestNumber = 0;
		for(vector<int>::iterator it = numberList.begin(); it != numberList.end(); it++)
		{
			if(*it == lowestNumber)
			{
				lowestNumber++;
			}
			else
			{
				break;
			}
		}

		if(lowestNumber > 0)
		{
			stringstream ss;
			ss << newName << lowestNumber;
			return ss.str();
		}
		else
		{
			return newName;
		}
	}
	else
	{
		return newName;
	}
}
开发者ID:rusty34,项目名称:TopCoder,代码行数:84,代码来源:UserName.cpp


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