本文整理汇总了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;
}
示例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;
}
示例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++;
}
}
示例4: foo
void foo(const vs &lines)
{
for (vs::const_iterator i(lines.begin()); i != lines.end(); ++i) {
cout << **i << endl;
}
}
示例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;
}
}