C++ STL中的SMANK最大值()函数

这个 smatch::max_size() 在C++ STL中是一个内置函数,它返回MsCHIOREST对象中可以由SimFrand容器保存的元素的最大数量。

null

语法:

smatch_name.max_size()

参数: 此函数不接受任何参数。 返回值: 此函数返回smatch容器中可容纳的最大元素数。

以下程序说明了上述功能:

方案1:

// C++ program to illustrate the
// smatch::max_size() function in C++ STL
// when data-type is char
#include <bits/stdc++.h>
using namespace std;
int main()
{
// match_results object(smatch)
match_results< char *> match;
cout << "max_size: " <<
match.max_size() << endl;
return 0;
}


输出:

max_size: 768614336404564650

方案2:

// C++ program to illustrate the
// smatch::max_size() function in C++ STL
// when data-type is int
#include <bits/stdc++.h>
using namespace std;
int main()
{
// match_results object(smatch)
match_results< int *> match;
cout << "max_size: " <<
match.max_size() << endl;
return 0;
}


输出:

max_size: 768614336404564650

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享