এই টিউটোরিয়ালে, আমরা C++ STL-এ মাল্টিসেট max_size() বোঝার জন্য একটি প্রোগ্রাম নিয়ে আলোচনা করব।
ফাংশন max_size() একটি প্রদত্ত কন্টেইনার ধরে রাখতে পারে এমন সর্বাধিক সংখ্যক উপাদান প্রদান করে।
উদাহরণ
#include <bits/stdc++.h>
using namespace std;
int main(){
multiset<int> s;
s.insert(10);
s.insert(13);
s.insert(13);
s.insert(25);
s.insert(24);
cout << "The multiset elements are: ";
for (auto it = s.begin(); it != s.end(); it++)
cout << *it << " ";
cout << "\nThe max size of multiset: " << s.max_size();
return 0;
} আউটপুট
The multiset elements are: 10 13 13 24 25 The max size of multiset: 461168601842738790